WIFI ioctl中SIOCSIWSCAN命令从应用程序到内核再到驱动
应用程序中:
ioctl(skfd, SIOCSIWSCAN , &wrq);
其中,#define SIOCSIWSCAN0x8B18
socket的ioctl先看net/socket.c的sock_ioctl
对于无线:
0x8B00 ~ 0x8BFF 调用net/core/dev.c --> dev_ioctl
dev_ioctl中执行到default中,最后调用了wireless_process_ioctl
对wireless_process_ioctl,又跑到了default中,如果有handler,最后到ioctl_standard_call中;
没有handler时,使用老的接口(dev->do_ioctl)。
handler = get_handler(dev, cmd);
if(handler != NULL) {
/* Standard and private are not the same */
if(cmd < SIOCIWFIRSTPRIV)
return ioctl_standard_call(dev,
ifr,
cmd,
handler);
else
return ioctl_private_call(dev,
ifr,
cmd,
handler);
}
/* Old driver API : call driver ioctl handler */
if (dev->do_ioctl) {
return dev->do_ioctl(dev, ifr, cmd);
}
有handler时,在具体WIFI驱动中,有类似如下实现:
netdev->wireless_handlers = (struct iw_handler_def *)&iwctl_handler_def;
const struct iw_handler_defiwctl_handler_def =
{
......
.get_wireless_stats = &iwctl_get_wireless_stats,
.standard= (iw_handler *) iwctl_handler,
......
}
static const iw_handleriwctl_handler[] =
{
(iw_handler) iwctl_commit, // SIOCSIWCOMMIT
......
......
(iw_handler) iwctl_giwrange,// SIOCGIWRANGE
......
......
#if WIRELESS_EXT > 13
(iw_handler) iwctl_siwscan, // SIOCSIWSCAN
(iw_handler) iwctl_giwscan, // SIOCGIWSCAN
#else
(iw_handler) NULL,
(iw_handler) NULL,
#endif
......
};
rt_ioctl_siwessid
分享到:
相关推荐
本文立足实践,不使用任何第三方库,仅使用 ioctl 扫描附近的 wifi 信号,并获取这些 AP 的 ESSID、MAC 地址、占用信道和工作频率,本文将给出完整的源程序,今后还会写一些文章讨论如果编程获取 wifi 信号的其它...
Wifi interfaces. If the device doesn't want to support tethering over Wifi this should be empty. An example would be "softap.*" --> <string-array translatable="false" name="config_tether_wifi_...
博通 WIFI 驱动核心代码 支持多种WIFI芯片
linux的rtl8188gu无线网卡驱动,可以解决8188gu芯片在linux无法识别的问题。解压后使用make命令
void userial_vendor_ioctl(userial_vendor_ioctl_op_t op, void *p_data) ^ hardware/broadcom/libbt/src/userial_vendor.c: In function 'userial_set_port': hardware/broadcom/libbt/src/userial_vendor.c:386...
#define CONFIG_OUT_EP_WIFI_MODE 0 #define ENABLE_USB_DROP_INCORRECT_OUT 0 #define RTL8192CU_ASIC_VERIFICATION 0 // For ASIC verification. #define RTL8192CU_ADHOC_WORKAROUND_SETTING 1 #define ...
旧版本版本的全志R16平台的tinav2.1的系统打开softAP 2017/9/14 17:25 版本:V1.0 1、原始编译: ...rootroot@cm-System-Product-Name:~$ cd /home/wwt/ ...rootroot@cm-System-Product-Name:/home/wwt$ tar zxvf...
该工程主要应用于获取苹果手机的mac地址,但前提是连接了wifi路由的情况下。原理:我们知道苹果是不允许我们获取其设备硬件的mac地址的,在iOS7以下才可以获得。iOS7以后苹果对于sysctl和ioctl进行了技术处理,MAC...
调通sina33下的AP6212A0(WIFI+BT) 大文实验室/大文哥 壹捌陆捌零陆捌捌陆捌贰 wb4916 AT qq.com 完成时间:2017/6/26 11:01 版本:V1.1 本文参照: 《A33 wifi移植说明书.pdf》 还有就是全志R16的parrotv1.1的...
obj-$(CONFIG_RTLWIFI) += rtlwifi/ obj-$(CONFIG_RTL8188EU) += rtl8188eu/ obj-$(CONFIG_RTL8188FU) += rtl8188fu/ obj-$(CONFIG_RTL8189ES) += rtl8189es/ obj-$(CONFIG_RTL8723BS) += rtl8723bs/ obj-$(CONFIG_...
if(-1 == ioctl(videofh, VIDIOC_STREAMOFF, &type;)){ hv_err("VIDIOC_STREAMOFF error! %s\n",strerror(errno)); goto quit; } cap->status = OFF; cap->cmd = COMMAND_UNUSED; capture_quit(capture); ...
2018\09\10 周一 17:27 <DIR> Native Wifi IHV Service 2018\09\10 周一 17:27 <DIR> NDIS 6.0 Filter Driver 2018\09\10 周一 17:27 <DIR> NDIS Connection-less Protocol Driver Sample 2018\09\10 周一 17:27 ...