Lines Matching full:device

49 rt_err_t rt_wlan_dev_init(struct rt_wlan_device *device, rt_wlan_mode_t mode)  in rt_wlan_dev_init()  argument
53 /* init wlan device */ in rt_wlan_dev_init()
54 LOG_D("F:%s L:%d is run device:0x%08x mode:%d", __FUNCTION__, __LINE__, device, mode); in rt_wlan_dev_init()
55 if ((device == RT_NULL) || (mode >= RT_WLAN_MODE_MAX)) in rt_wlan_dev_init()
57 … LOG_E("F:%s L:%d Parameter Wrongful device:0x%08x mode:%d", __FUNCTION__, __LINE__, device, mode); in rt_wlan_dev_init()
61 result = rt_device_init(RT_DEVICE(device)); in rt_wlan_dev_init()
67 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_MODE, (void *)&mode); in rt_wlan_dev_init()
73 device->mode = mode; in rt_wlan_dev_init()
77 rt_err_t rt_wlan_dev_connect(struct rt_wlan_device *device, struct rt_wlan_info *info, const char *… in rt_wlan_dev_connect() argument
82 if (device == RT_NULL) in rt_wlan_dev_connect()
108 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_JOIN, &sta_info); in rt_wlan_dev_connect()
112 rt_err_t rt_wlan_dev_disconnect(struct rt_wlan_device *device) in rt_wlan_dev_disconnect() argument
116 if (device == RT_NULL) in rt_wlan_dev_disconnect()
121 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_DISCONNECT, RT_NULL); in rt_wlan_dev_disconnect()
125 rt_err_t rt_wlan_dev_ap_start(struct rt_wlan_device *device, struct rt_wlan_info *info, const char … in rt_wlan_dev_ap_start() argument
130 if (device == RT_NULL) in rt_wlan_dev_ap_start()
157 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_SOFTAP, &ap_info); in rt_wlan_dev_ap_start()
161 rt_err_t rt_wlan_dev_ap_stop(struct rt_wlan_device *device) in rt_wlan_dev_ap_stop() argument
165 if (device == RT_NULL) in rt_wlan_dev_ap_stop()
170 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_AP_STOP, RT_NULL); in rt_wlan_dev_ap_stop()
174 rt_err_t rt_wlan_dev_ap_deauth(struct rt_wlan_device *device, rt_uint8_t mac[6]) in rt_wlan_dev_ap_deauth() argument
178 if (device == RT_NULL) in rt_wlan_dev_ap_deauth()
183 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_AP_DEAUTH, mac); in rt_wlan_dev_ap_deauth()
187 int rt_wlan_dev_get_rssi(struct rt_wlan_device *device) in rt_wlan_dev_get_rssi() argument
192 if (device == RT_NULL) in rt_wlan_dev_get_rssi()
198 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_GET_RSSI, &rssi); in rt_wlan_dev_get_rssi()
208 rt_err_t rt_wlan_dev_get_mac(struct rt_wlan_device *device, rt_uint8_t mac[6]) in rt_wlan_dev_get_mac() argument
212 if (device == RT_NULL) in rt_wlan_dev_get_mac()
217 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_GET_MAC, &mac[0]); in rt_wlan_dev_get_mac()
221 rt_err_t rt_wlan_dev_set_mac(struct rt_wlan_device *device, rt_uint8_t mac[6]) in rt_wlan_dev_set_mac() argument
225 if (device == RT_NULL) in rt_wlan_dev_set_mac()
230 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_SET_MAC, &mac[0]); in rt_wlan_dev_set_mac()
234 rt_err_t rt_wlan_dev_set_powersave(struct rt_wlan_device *device, int level) in rt_wlan_dev_set_powersave() argument
238 if (device == RT_NULL) in rt_wlan_dev_set_powersave()
243 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_SET_POWERSAVE, &level); in rt_wlan_dev_set_powersave()
247 int rt_wlan_dev_get_powersave(struct rt_wlan_device *device) in rt_wlan_dev_get_powersave() argument
252 if (device == RT_NULL) in rt_wlan_dev_get_powersave()
258 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_GET_POWERSAVE, &level); in rt_wlan_dev_get_powersave()
267 rt_err_t rt_wlan_dev_register_event_handler(struct rt_wlan_device *device, rt_wlan_dev_event_t even… in rt_wlan_dev_register_event_handler() argument
272 if (device == RT_NULL) in rt_wlan_dev_register_event_handler()
284 if (device->handler_table[event][i].handler == RT_NULL) in rt_wlan_dev_register_event_handler()
286 device->handler_table[event][i].handler = handler; in rt_wlan_dev_register_event_handler()
287 device->handler_table[event][i].parameter = parameter; in rt_wlan_dev_register_event_handler()
298 rt_err_t rt_wlan_dev_unregister_event_handler(struct rt_wlan_device *device, rt_wlan_dev_event_t ev… in rt_wlan_dev_unregister_event_handler() argument
303 if (device == RT_NULL) in rt_wlan_dev_unregister_event_handler()
315 if (device->handler_table[event][i].handler == handler) in rt_wlan_dev_unregister_event_handler()
317 rt_memset(&device->handler_table[event][i], 0, sizeof(struct rt_wlan_dev_event_desc)); in rt_wlan_dev_unregister_event_handler()
327 void rt_wlan_dev_indicate_event_handle(struct rt_wlan_device *device, rt_wlan_dev_event_t event, st… in rt_wlan_dev_indicate_event_handle() argument
334 if (device == RT_NULL) in rt_wlan_dev_indicate_event_handle()
347 handler[i] = device->handler_table[event][i].handler; in rt_wlan_dev_indicate_event_handle()
348 parameter[i] = device->handler_table[event][i].parameter; in rt_wlan_dev_indicate_event_handle()
357 handler[i](device, event, buff, parameter[i]); in rt_wlan_dev_indicate_event_handle()
362 rt_err_t rt_wlan_dev_enter_promisc(struct rt_wlan_device *device) in rt_wlan_dev_enter_promisc() argument
367 if (device == RT_NULL) in rt_wlan_dev_enter_promisc()
372 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_CFG_PROMISC, &enable); in rt_wlan_dev_enter_promisc()
376 rt_err_t rt_wlan_dev_exit_promisc(struct rt_wlan_device *device) in rt_wlan_dev_exit_promisc() argument
381 if (device == RT_NULL) in rt_wlan_dev_exit_promisc()
386 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_CFG_PROMISC, &enable); in rt_wlan_dev_exit_promisc()
390 rt_err_t rt_wlan_dev_set_promisc_callback(struct rt_wlan_device *device, rt_wlan_pormisc_callback_t… in rt_wlan_dev_set_promisc_callback() argument
392 if (device == RT_NULL) in rt_wlan_dev_set_promisc_callback()
396 device->pormisc_callback = callback; in rt_wlan_dev_set_promisc_callback()
401 void rt_wlan_dev_promisc_handler(struct rt_wlan_device *device, void *data, int len) in rt_wlan_dev_promisc_handler() argument
405 if (device == RT_NULL) in rt_wlan_dev_promisc_handler()
410 callback = device->pormisc_callback; in rt_wlan_dev_promisc_handler()
414 callback(device, data, len); in rt_wlan_dev_promisc_handler()
418 rt_err_t rt_wlan_dev_cfg_filter(struct rt_wlan_device *device, struct rt_wlan_filter *filter) in rt_wlan_dev_cfg_filter() argument
422 if (device == RT_NULL) in rt_wlan_dev_cfg_filter()
431 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_CFG_FILTER, filter); in rt_wlan_dev_cfg_filter()
435 rt_err_t rt_wlan_dev_set_channel(struct rt_wlan_device *device, int channel) in rt_wlan_dev_set_channel() argument
439 if (device == RT_NULL) in rt_wlan_dev_set_channel()
448 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_SET_CHANNEL, &channel); in rt_wlan_dev_set_channel()
452 int rt_wlan_dev_get_channel(struct rt_wlan_device *device) in rt_wlan_dev_get_channel() argument
457 if (device == RT_NULL) in rt_wlan_dev_get_channel()
463 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_GET_CHANNEL, &channel); in rt_wlan_dev_get_channel()
473 rt_err_t rt_wlan_dev_set_country(struct rt_wlan_device *device, rt_country_code_t country_code) in rt_wlan_dev_set_country() argument
477 if (device == RT_NULL) in rt_wlan_dev_set_country()
482 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_SET_COUNTRY, &country_code); in rt_wlan_dev_set_country()
486 rt_country_code_t rt_wlan_dev_get_country(struct rt_wlan_device *device) in rt_wlan_dev_get_country() argument
491 if (device == RT_NULL) in rt_wlan_dev_get_country()
497 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_GET_COUNTRY, &country_code); in rt_wlan_dev_get_country()
507 rt_err_t rt_wlan_dev_scan(struct rt_wlan_device *device, struct rt_wlan_info *info) in rt_wlan_dev_scan() argument
513 if (device == RT_NULL) in rt_wlan_dev_scan()
531 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_SCAN, p_scan_info); in rt_wlan_dev_scan()
535 rt_err_t rt_wlan_dev_scan_stop(struct rt_wlan_device *device) in rt_wlan_dev_scan_stop() argument
539 if (device == RT_NULL) in rt_wlan_dev_scan_stop()
544 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_SCAN_STOP, RT_NULL); in rt_wlan_dev_scan_stop()
548 rt_err_t rt_wlan_dev_report_data(struct rt_wlan_device *device, void *buff, int len) in rt_wlan_dev_report_data() argument
550 return rt_wlan_dev_transfer_prot(device, buff, len); in rt_wlan_dev_report_data()
782 wlan->device.ops = &wlan_ops; in rt_wlan_dev_register()
784 wlan->device.init = _rt_wlan_dev_init; in rt_wlan_dev_register()
785 wlan->device.open = RT_NULL; in rt_wlan_dev_register()
786 wlan->device.close = RT_NULL; in rt_wlan_dev_register()
787 wlan->device.read = RT_NULL; in rt_wlan_dev_register()
788 wlan->device.write = RT_NULL; in rt_wlan_dev_register()
789 wlan->device.control = _rt_wlan_dev_control; in rt_wlan_dev_register()
792 wlan->device.user_data = RT_NULL; in rt_wlan_dev_register()
794 wlan->device.type = RT_Device_Class_NetIf; in rt_wlan_dev_register()
800 err = rt_device_register(&wlan->device, name, RT_DEVICE_FLAG_RDWR); in rt_wlan_dev_register()