From owner-freebsd-wireless@freebsd.org Mon Apr 18 04:40:13 2016 Return-Path: Delivered-To: freebsd-wireless@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A5BCB111AD for ; Mon, 18 Apr 2016 04:40:13 +0000 (UTC) (envelope-from fnoyanisi@yahoo.com) Received: from nm2-vm5.bullet.mail.ne1.yahoo.com (nm2-vm5.bullet.mail.ne1.yahoo.com [98.138.91.224]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 682AC1C87 for ; Mon, 18 Apr 2016 04:40:12 +0000 (UTC) (envelope-from fnoyanisi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1460954230; bh=BrqF53jaIAnOylbK+X5cSiJq9SgkhvMBBm6mIX3Uqy0=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=FltEkIO+a4LP872PWysg1Is8m7KmuAIRRua7CQ2IClU3sosqO+sgHwASgebm6bq26CAraL6/V4/oy5cPBUuz02yTEO0Ea6Ttmm+8Hkdp/O2sSbZB86zSjkRcIY5KE6Ah20Wz56wNc6HykWGD4FurhfR/gV01qOfEK+UlguhwrQ6kecCHueJpEgFUojs+fYgQBNAgej5cDWbv/GnN+g0UVKboqjcNti5LVdDQeSLUGdLhifqgVzljPf9p9rAMxdlNRfh59Mcu3k/rMqEW8wFxl2fkV/Eit+Iw5UME+ypfmfvJgzE7gxQv01KZdc7m1PeeAtEKKPcsiT9wbSQHE3ow8w== Received: from [98.138.226.176] by nm2.bullet.mail.ne1.yahoo.com with NNFMP; 18 Apr 2016 04:37:10 -0000 Received: from [98.138.86.157] by tm11.bullet.mail.ne1.yahoo.com with NNFMP; 18 Apr 2016 04:37:10 -0000 Received: from [127.0.0.1] by omp1015.mail.ne1.yahoo.com with NNFMP; 18 Apr 2016 04:37:10 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 79266.44302.bm@omp1015.mail.ne1.yahoo.com X-YMail-OSG: oKVD.ToVM1lb8kpMzvzWnqiueAtCcy3iqNw1J_0EnZYkRL1B9sJmB66KZNemdi2 vmBR5hTvReNpmYrb0jTZDDoF0iqWsIu.Zg0GXOhcUPofqWZL.qXD6bPvwVVMPE6DYi9SJjtKDEGv gooGqXLiEAAv4.ENuH0fh5ksmRYNksnCITzj5GejBNvEcEvZVAjIeNM3N.x8pel8wFf1Cnfb.xcz B71Ar6UDxTEwZOc8vUAD5duMzYrGvoofVu29Que8QcRMFHk2yaXQzmDA0PIdh.fdR7tgWiBCr0Gn Gbuxh9UrYPRqH1Ma8g.sj3H2_Ew70goMKx50YR7geNVURL63uqahgZGJM9Nlnt3sByve7Rf7_12m _LieudBViMQS4LMSvxw7.0LUt1PKP4js9P_veYUC4YUADZ45s14IATYlG.afOTbq9XRun02oCtLb gR3aFAtKeSVFwLcelRSq.QmxubNbIPYxbNaC1h6o5eam56r7qD11_LbTkBU_LaXfPc0GVdmkXlW1 KYQeW26E- Received: by 98.138.105.216; Mon, 18 Apr 2016 04:37:09 +0000 Date: Mon, 18 Apr 2016 04:37:09 +0000 (UTC) From: Fehmi Noyan ISI Reply-To: Fehmi Noyan ISI To: "freebsd-wireless@freebsd.org" Message-ID: <1577375135.1864049.1460954229303.JavaMail.yahoo@mail.yahoo.com> Subject: struct ieee80211req_scan_result and couple of questions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit References: <1577375135.1864049.1460954229303.JavaMail.yahoo.ref@mail.yahoo.com> X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 04:40:13 -0000 Hi there, I have been digging into the IEEE 802.11 related code for a couple of days and need to clarify some points (or get my interpretation of the code confirmed :} ). So, here are some gray areas I have; 1 ) ioctl(2) returns a memory address (in i_data field of ireq structure) which points a series of "ieee80211req_scan_result" structures when request type is IEEE80211_IOC_SCAN_RESULTS, and it is the programmer's responsibility to parse the returned data in a proper way? The code for list_scan(int) in sbin/ifconfig/ifieee80211.c is a good example to this? 2 ) The "mesh" networking related parts of "ieee80211req_scan_result" structure are IEEE 802.11s additions? 3 ) A "ieee80211req_scan_result" structure can either have an SSID or a MESH ID? If so, in the code snippet below (from sbin/ifconfig/ifieee80211.c) /* cp points a memory location returned by ioctl(2) * when request = IEEE80211_IOC_SCAN_RESULTS */ const uint8_t *vp, *idp; sr = (const struct ieee80211req_scan_result *) cp; vp = cp + sr->isr_ie_off; if (sr->isr_meshid_len) { idp = vp + sr->isr_ssid_len; idlen = sr->isr_meshid_len; } else { idp = vp; idlen = sr->isr_ssid_len; } why don't we have if (sr->isr_meshid_len) { idp = vp + sr->isr_meshid_len; /* THIS LINE */ idlen = sr->isr_meshid_len; } else { idp = vp; idlen = sr->isr_ssid_len; } Assuming the memory is organized like this +-------------------+----+------+---------+ | Fixed Size struct | IE | SSID | MESH ID | +-------------------+----+------+---------+ 4 ) NET80211(4) manual page does not include the description of ieee80211req_scan_result structure. Would be good to have in the manual page rather than reading the net80211/ieee80211_ioctl.h file. I am happy to submit a patch if you aggree that a definition of ieee80211req_scan_result should appear in net80211(4). This will be freebsd-doc related issue then. Regards Fehmi