31 #include <linux/module.h>
46 static char ifname[
IFNAMSIZ] =
"wlan%d";
50 static int rfintfs =
HWPI;
53 static int ampdu_enable = 1;
63 static int vrtl_carrier_sense =
AUTO_VCS;
65 static int frag_thresh = 2346;
68 static int adhoc_tx_pwr = 1;
70 static int smart_ps = 1;
72 static int radio_enable = 1;
73 static int long_retry_lmt = 7;
74 static int short_retry_lmt = 7;
75 static int busy_thresh = 40;
78 static int software_encrypt;
79 static int software_decrypt;
81 static int wmm_enable;
82 static int uapsd_enable;
84 static int uapsd_acbk_en;
85 static int uapsd_acbe_en;
86 static int uapsd_acvi_en;
87 static int uapsd_acvo_en;
89 static int ht_enable = 1;
90 static int cbw40_enable = 1;
127 static int netdev_open(
struct net_device *pnetdev);
128 static int netdev_close(
struct net_device *pnetdev);
141 registry_par->
ssid.SsidLength = 3;
179 static int r871x_net_set_mac_address(
struct net_device *pnetdev,
void *
p)
184 if (padapter->
bup ==
false)
201 return &padapter->
stats;
205 .ndo_open = netdev_open,
206 .ndo_stop = netdev_close,
208 .ndo_set_mac_address = r871x_net_set_mac_address,
209 .ndo_get_stats = r871x_net_get_stats,
218 pnetdev = alloc_etherdev(
sizeof(
struct _adapter));
225 padapter = (
struct _adapter *) netdev_priv(pnetdev);
234 loadparam(padapter, pnetdev);
240 static u32 start_drv_threads(
struct _adapter *padapter)
254 _down_sema(&padapter->
cmdpriv.terminate_cmdthread_sema);
258 static void start_drv_timers(
struct _adapter *padapter)
260 _set_timer(&padapter->
mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer,
262 _set_timer(&padapter->
mlmepriv.wdg_timer, 2000);
267 _cancel_timer_ex(&padapter->
mlmepriv.assoc_timer);
269 _cancel_timer_ex(&padapter->
mlmepriv.scan_to_timer);
270 _cancel_timer_ex(&padapter->
mlmepriv.dhcp_timer);
271 _cancel_timer_ex(&padapter->
mlmepriv.wdg_timer);
272 _cancel_timer_ex(&padapter->
mlmepriv.sitesurveyctrl.
273 sitesurvey_ctrl_timer);
276 static u8 init_default_value(
struct _adapter *padapter)
299 for (i = 0; i < 16; i++)
318 padapter->
cmdpriv.padapter = padapter;
330 padapter->
stapriv.padapter = padapter;
334 if (init_default_value(padapter) !=
_SUCCESS)
360 static void enable_video_mode(
struct _adapter *padapter,
int cbw40_value)
372 u32 intcmd = 0xf4000500;
388 static int netdev_open(
struct net_device *pnetdev)
393 if (padapter->
bup ==
false) {
396 padapter->
bup =
true;
398 goto netdev_open_error;
421 if (start_drv_threads(padapter) !=
_SUCCESS)
422 goto netdev_open_error;
424 goto netdev_open_error;
426 padapter->
dvobjpriv.inirp_init(padapter);
430 if (!netif_queue_stopped(pnetdev))
431 netif_start_queue(pnetdev);
433 netif_wake_queue(pnetdev);
436 enable_video_mode(padapter, cbw40_enable);
438 start_drv_timers(padapter);
443 padapter->
bup =
false;
445 netif_stop_queue(pnetdev);
456 static int netdev_close(
struct net_device *pnetdev)
466 if (!netif_queue_stopped(pnetdev))
467 netif_stop_queue(pnetdev);