29 #define _RTL871X_CMD_C_
31 #include <linux/compiler.h>
32 #include <linux/kernel.h>
33 #include <linux/errno.h>
35 #include <linux/slab.h>
36 #include <linux/module.h>
38 #include <linux/netdevice.h>
41 #include <linux/usb/ch9.h>
44 #include <asm/byteorder.h>
47 #include <linux/rtnetlink.h>
99 static void _free_evt_priv(
struct evt_priv *pevtpriv)
104 static void _free_cmd_priv(
struct cmd_priv *pcmdpriv)
129 list_insert_tail(&obj->
list, &queue->
queue);
130 spin_unlock_irqrestore(&queue->
lock, irqL);
140 if (is_list_empty(&(queue->
queue)))
145 list_delete(&obj->
list);
147 spin_unlock_irqrestore(&(queue->
lock), irqL);
153 return _init_cmd_priv(pcmdpriv);
158 return _init_evt_priv(pevtpriv);
163 _free_evt_priv(pevtpriv);
168 _free_cmd_priv(pcmdpriv);
175 if (pcmdpriv->
padapter->eeprompriv.bautoload_fail_flag ==
true)
177 res = _enqueue_cmd(&pcmdpriv->
cmd_queue, obj);
189 if (pcmdpriv->
padapter->eeprompriv.bautoload_fail_flag ==
true)
193 list_insert_tail(&obj->
list, &queue->
queue);
194 spin_unlock_irqrestore(&queue->
lock, irqL);
201 return _dequeue_cmd(queue);
206 if ((pcmd->
cmdcode != _JoinBss_CMD_) &&
207 (pcmd->
cmdcode != _CreateBss_CMD_))
210 if (pcmd->
rspsz != 0)
213 kfree((
unsigned char *)pcmd);
235 if (psurveyPara ==
NULL) {
236 kfree((
unsigned char *) ph2c);
268 if (pbsetdataratepara ==
NULL) {
274 pbsetdataratepara->
mac_id = 5;
291 if (psetchplanpara ==
NULL) {
313 if (pssetbasicratepara ==
NULL) {
336 if (pwriteptmparm ==
NULL) {
357 if (pwriteptmparm ==
NULL) {
378 if (pwriteptmparm ==
NULL) {
399 if (pwriterfparm ==
NULL) {
420 if (prdrfparm ==
NULL) {
424 _init_listhead(&ph2c->
list);
426 ph2c->
parmbuf = (
unsigned char *)prdrfparm;
440 padapter->
mppriv.workparam.bcompleted =
true;
449 padapter->
mppriv.workparam.bcompleted =
true;
463 _init_listhead(&pcmd->
list);
464 pcmd->
cmdcode = _CreateBss_CMD_;
465 pcmd->
parmbuf = (
unsigned char *)pdev_network;
475 pdev_network->
Ssid.SsidLength);
492 network.InfrastructureMode;
498 t_len =
sizeof(
u32) + 6 *
sizeof(
unsigned char) + 2 +
501 sizeof(enum NDIS_802_11_NETWORK_TYPE) +
502 sizeof(struct NDIS_802_11_CONFIGURATION) +
503 sizeof(enum NDIS_802_11_NETWORK_INFRASTRUCTURE) +
504 sizeof(NDIS_802_11_RATES_EX) +
505 sizeof(u32) + MAX_IE_SZ;
510 switch (ndis_network_mode) {
524 if (psecnetwork ==
NULL) {
528 memset(psecnetwork, 0, t_len);
538 &psecnetwork->
IEs[12], (256-1));
549 &psecnetwork->
IEs[0],
557 &psecnetwork->
IEs[0],
560 if (psecnetwork->
IELength != tmp_len) {
576 &psecnetwork->
IEs[0],
594 psecnetwork->
Ssid.SsidLength);
619 _init_listhead(&pcmd->
list);
621 pcmd->
parmbuf = (
unsigned char *)psecnetwork;
630 struct cmd_obj *pdisconnect_cmd;
634 pdisconnect_cmd = (
struct cmd_obj *)_malloc(
sizeof(
struct cmd_obj));
635 if (pdisconnect_cmd ==
NULL)
639 if (pdisconnect ==
NULL) {
662 if (psetop ==
NULL) {
667 psetop->
mode = (
u8)networktype;
687 if (psetstakey_para ==
NULL) {
693 if (psetstakey_rsp ==
NULL) {
699 ph2c->
rsp = (
u8 *) psetstakey_rsp;
708 if (unicast_key ==
true)
713 psecuritypriv->
XGrpKeyid - 1]. skey, 16);
729 if (psetrfintfsparm ==
NULL) {
730 kfree((
unsigned char *) ph2c);
752 if (psetrttblparm ==
NULL) {
753 kfree((
unsigned char *)ph2c);
774 if (prdtssiparm ==
NULL) {
775 kfree((
unsigned char *) ph2c);
778 _init_listhead(&ph2c->
list);
780 ph2c->
parmbuf = (
unsigned char *)prdtssiparm;
801 if (psetMacAddr_para ==
NULL) {
806 _SetMacAddress_CMD_);
824 if (psetassocsta_para ==
NULL) {
830 if (psetassocsta_rsp ==
NULL) {
832 kfree((
u8 *)psetassocsta_para);
836 ph2c->
rsp = (
u8 *) psetassocsta_rsp;
854 if (paddbareq_parm ==
NULL) {
855 kfree((
unsigned char *)ph2c);
858 paddbareq_parm->
tid =
tid;
876 if (pdrvintcmd_param ==
NULL) {
877 kfree((
unsigned char *)ph2c);
881 pdrvintcmd_param->
sz = 0;
906 spin_unlock_irqrestore(&pmlmepriv->
lock, irqL);
935 _cancel_timer(&pmlmepriv->
assoc_timer, &timer_cancelled);
969 goto createbss_cmd_fail ;
978 goto createbss_cmd_fail;
981 list_insert_tail(&(pwlan->
list),
986 memcpy(&tgt_network->network, pnetwork,
994 spin_unlock_irqrestore(&pmlmepriv->
lock, irqL);
1005 psetstakey_rsp->
addr);
1025 passocsta_parm->
addr);
1035 spin_unlock_irqrestore(&pmlmepriv->
lock, irqL);
1040 u32 tryPktCnt,
u32 tryPktInterval,
u32 firstStageTO)
1051 if (param ==
NULL) {
1052 kfree((
unsigned char *) ph2c);