diff options
Diffstat (limited to 'drivers/staging/wlan-ng/prism2sta.c')
-rw-r--r-- | drivers/staging/wlan-ng/prism2sta.c | 268 |
1 files changed, 126 insertions, 142 deletions
diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index 573e93ae7d4..f493cf430db 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c | |||
@@ -127,37 +127,37 @@ MODULE_PARM_DESC(prism2_reset_settletime, "reset settle time in ms"); | |||
127 | 127 | ||
128 | MODULE_LICENSE("Dual MPL/GPL"); | 128 | MODULE_LICENSE("Dual MPL/GPL"); |
129 | 129 | ||
130 | static int prism2sta_open(wlandevice_t *wlandev); | 130 | static int prism2sta_open(wlandevice_t * wlandev); |
131 | static int prism2sta_close(wlandevice_t *wlandev); | 131 | static int prism2sta_close(wlandevice_t * wlandev); |
132 | static void prism2sta_reset(wlandevice_t *wlandev); | 132 | static void prism2sta_reset(wlandevice_t * wlandev); |
133 | static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, | 133 | static int prism2sta_txframe(wlandevice_t * wlandev, struct sk_buff *skb, |
134 | p80211_hdr_t *p80211_hdr, | 134 | p80211_hdr_t * p80211_hdr, |
135 | p80211_metawep_t *p80211_wep); | 135 | p80211_metawep_t * p80211_wep); |
136 | static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg); | 136 | static int prism2sta_mlmerequest(wlandevice_t * wlandev, p80211msg_t * msg); |
137 | static int prism2sta_getcardinfo(wlandevice_t *wlandev); | 137 | static int prism2sta_getcardinfo(wlandevice_t * wlandev); |
138 | static int prism2sta_globalsetup(wlandevice_t *wlandev); | 138 | static int prism2sta_globalsetup(wlandevice_t * wlandev); |
139 | static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev); | 139 | static int prism2sta_setmulticast(wlandevice_t * wlandev, netdevice_t * dev); |
140 | 140 | ||
141 | static void prism2sta_inf_handover(wlandevice_t *wlandev, | 141 | static void prism2sta_inf_handover(wlandevice_t * wlandev, |
142 | hfa384x_InfFrame_t *inf); | 142 | hfa384x_InfFrame_t * inf); |
143 | static void prism2sta_inf_tallies(wlandevice_t *wlandev, | 143 | static void prism2sta_inf_tallies(wlandevice_t * wlandev, |
144 | hfa384x_InfFrame_t *inf); | 144 | hfa384x_InfFrame_t * inf); |
145 | static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev, | 145 | static void prism2sta_inf_hostscanresults(wlandevice_t * wlandev, |
146 | hfa384x_InfFrame_t *inf); | 146 | hfa384x_InfFrame_t * inf); |
147 | static void prism2sta_inf_scanresults(wlandevice_t *wlandev, | 147 | static void prism2sta_inf_scanresults(wlandevice_t * wlandev, |
148 | hfa384x_InfFrame_t *inf); | 148 | hfa384x_InfFrame_t * inf); |
149 | static void prism2sta_inf_chinforesults(wlandevice_t *wlandev, | 149 | static void prism2sta_inf_chinforesults(wlandevice_t * wlandev, |
150 | hfa384x_InfFrame_t *inf); | 150 | hfa384x_InfFrame_t * inf); |
151 | static void prism2sta_inf_linkstatus(wlandevice_t *wlandev, | 151 | static void prism2sta_inf_linkstatus(wlandevice_t * wlandev, |
152 | hfa384x_InfFrame_t *inf); | 152 | hfa384x_InfFrame_t * inf); |
153 | static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, | 153 | static void prism2sta_inf_assocstatus(wlandevice_t * wlandev, |
154 | hfa384x_InfFrame_t *inf); | 154 | hfa384x_InfFrame_t * inf); |
155 | static void prism2sta_inf_authreq(wlandevice_t *wlandev, | 155 | static void prism2sta_inf_authreq(wlandevice_t * wlandev, |
156 | hfa384x_InfFrame_t *inf); | 156 | hfa384x_InfFrame_t * inf); |
157 | static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev, | 157 | static void prism2sta_inf_authreq_defer(wlandevice_t * wlandev, |
158 | hfa384x_InfFrame_t *inf); | 158 | hfa384x_InfFrame_t * inf); |
159 | static void prism2sta_inf_psusercnt(wlandevice_t *wlandev, | 159 | static void prism2sta_inf_psusercnt(wlandevice_t * wlandev, |
160 | hfa384x_InfFrame_t *inf); | 160 | hfa384x_InfFrame_t * inf); |
161 | 161 | ||
162 | /*---------------------------------------------------------------- | 162 | /*---------------------------------------------------------------- |
163 | * prism2sta_open | 163 | * prism2sta_open |
@@ -180,7 +180,7 @@ static void prism2sta_inf_psusercnt(wlandevice_t *wlandev, | |||
180 | * Call context: | 180 | * Call context: |
181 | * process thread | 181 | * process thread |
182 | ----------------------------------------------------------------*/ | 182 | ----------------------------------------------------------------*/ |
183 | static int prism2sta_open(wlandevice_t *wlandev) | 183 | static int prism2sta_open(wlandevice_t * wlandev) |
184 | { | 184 | { |
185 | /* We don't currently have to do anything else. | 185 | /* We don't currently have to do anything else. |
186 | * The setup of the MAC should be subsequently completed via | 186 | * The setup of the MAC should be subsequently completed via |
@@ -214,7 +214,7 @@ static int prism2sta_open(wlandevice_t *wlandev) | |||
214 | * Call context: | 214 | * Call context: |
215 | * process thread | 215 | * process thread |
216 | ----------------------------------------------------------------*/ | 216 | ----------------------------------------------------------------*/ |
217 | static int prism2sta_close(wlandevice_t *wlandev) | 217 | static int prism2sta_close(wlandevice_t * wlandev) |
218 | { | 218 | { |
219 | /* We don't currently have to do anything else. | 219 | /* We don't currently have to do anything else. |
220 | * Higher layers know we're not ready from dev->start==0 and | 220 | * Higher layers know we're not ready from dev->start==0 and |
@@ -242,7 +242,7 @@ static int prism2sta_close(wlandevice_t *wlandev) | |||
242 | * Call context: | 242 | * Call context: |
243 | * process thread | 243 | * process thread |
244 | ----------------------------------------------------------------*/ | 244 | ----------------------------------------------------------------*/ |
245 | static void prism2sta_reset(wlandevice_t *wlandev) | 245 | static void prism2sta_reset(wlandevice_t * wlandev) |
246 | { | 246 | { |
247 | return; | 247 | return; |
248 | } | 248 | } |
@@ -268,9 +268,9 @@ static void prism2sta_reset(wlandevice_t *wlandev) | |||
268 | * Call context: | 268 | * Call context: |
269 | * process thread | 269 | * process thread |
270 | ----------------------------------------------------------------*/ | 270 | ----------------------------------------------------------------*/ |
271 | static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, | 271 | static int prism2sta_txframe(wlandevice_t * wlandev, struct sk_buff *skb, |
272 | p80211_hdr_t *p80211_hdr, | 272 | p80211_hdr_t * p80211_hdr, |
273 | p80211_metawep_t *p80211_wep) | 273 | p80211_metawep_t * p80211_wep) |
274 | { | 274 | { |
275 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 275 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
276 | int result; | 276 | int result; |
@@ -310,7 +310,7 @@ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, | |||
310 | * Call context: | 310 | * Call context: |
311 | * process thread | 311 | * process thread |
312 | ----------------------------------------------------------------*/ | 312 | ----------------------------------------------------------------*/ |
313 | static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg) | 313 | static int prism2sta_mlmerequest(wlandevice_t * wlandev, p80211msg_t * msg) |
314 | { | 314 | { |
315 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 315 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
316 | 316 | ||
@@ -401,12 +401,9 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg) | |||
401 | qualmsg->noise.status = | 401 | qualmsg->noise.status = |
402 | P80211ENUM_msgitem_status_data_ok; | 402 | P80211ENUM_msgitem_status_data_ok; |
403 | 403 | ||
404 | qualmsg->link.data = | 404 | qualmsg->link.data = le16_to_cpu(hw->qual.CQ_currBSS); |
405 | le16_to_cpu(hw->qual.CQ_currBSS); | 405 | qualmsg->level.data = le16_to_cpu(hw->qual.ASL_currBSS); |
406 | qualmsg->level.data = | 406 | qualmsg->noise.data = le16_to_cpu(hw->qual.ANL_currFC); |
407 | le16_to_cpu(hw->qual.ASL_currBSS); | ||
408 | qualmsg->noise.data = | ||
409 | le16_to_cpu(hw->qual.ANL_currFC); | ||
410 | 407 | ||
411 | break; | 408 | break; |
412 | } | 409 | } |
@@ -440,7 +437,7 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg) | |||
440 | * process thread (usually) | 437 | * process thread (usually) |
441 | * interrupt | 438 | * interrupt |
442 | ----------------------------------------------------------------*/ | 439 | ----------------------------------------------------------------*/ |
443 | u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) | 440 | u32 prism2sta_ifstate(wlandevice_t * wlandev, u32 ifstate) |
444 | { | 441 | { |
445 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 442 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
446 | u32 result; | 443 | u32 result; |
@@ -448,7 +445,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) | |||
448 | result = P80211ENUM_resultcode_implementation_failure; | 445 | result = P80211ENUM_resultcode_implementation_failure; |
449 | 446 | ||
450 | pr_debug("Current MSD state(%d), requesting(%d)\n", | 447 | pr_debug("Current MSD state(%d), requesting(%d)\n", |
451 | wlandev->msdstate, ifstate); | 448 | wlandev->msdstate, ifstate); |
452 | switch (ifstate) { | 449 | switch (ifstate) { |
453 | case P80211ENUM_ifstate_fwload: | 450 | case P80211ENUM_ifstate_fwload: |
454 | switch (wlandev->msdstate) { | 451 | switch (wlandev->msdstate) { |
@@ -610,7 +607,7 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate) | |||
610 | * Call context: | 607 | * Call context: |
611 | * Either. | 608 | * Either. |
612 | ----------------------------------------------------------------*/ | 609 | ----------------------------------------------------------------*/ |
613 | static int prism2sta_getcardinfo(wlandevice_t *wlandev) | 610 | static int prism2sta_getcardinfo(wlandevice_t * wlandev) |
614 | { | 611 | { |
615 | int result = 0; | 612 | int result = 0; |
616 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 613 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
@@ -811,10 +808,8 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) | |||
811 | fields in byte order */ | 808 | fields in byte order */ |
812 | hw->cap_act_pri_cfi.role = le16_to_cpu(hw->cap_act_pri_cfi.role); | 809 | hw->cap_act_pri_cfi.role = le16_to_cpu(hw->cap_act_pri_cfi.role); |
813 | hw->cap_act_pri_cfi.id = le16_to_cpu(hw->cap_act_pri_cfi.id); | 810 | hw->cap_act_pri_cfi.id = le16_to_cpu(hw->cap_act_pri_cfi.id); |
814 | hw->cap_act_pri_cfi.variant = | 811 | hw->cap_act_pri_cfi.variant = le16_to_cpu(hw->cap_act_pri_cfi.variant); |
815 | le16_to_cpu(hw->cap_act_pri_cfi.variant); | 812 | hw->cap_act_pri_cfi.bottom = le16_to_cpu(hw->cap_act_pri_cfi.bottom); |
816 | hw->cap_act_pri_cfi.bottom = | ||
817 | le16_to_cpu(hw->cap_act_pri_cfi.bottom); | ||
818 | hw->cap_act_pri_cfi.top = le16_to_cpu(hw->cap_act_pri_cfi.top); | 813 | hw->cap_act_pri_cfi.top = le16_to_cpu(hw->cap_act_pri_cfi.top); |
819 | 814 | ||
820 | printk(KERN_INFO | 815 | printk(KERN_INFO |
@@ -836,10 +831,8 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) | |||
836 | fields in byte order */ | 831 | fields in byte order */ |
837 | hw->cap_act_sta_cfi.role = le16_to_cpu(hw->cap_act_sta_cfi.role); | 832 | hw->cap_act_sta_cfi.role = le16_to_cpu(hw->cap_act_sta_cfi.role); |
838 | hw->cap_act_sta_cfi.id = le16_to_cpu(hw->cap_act_sta_cfi.id); | 833 | hw->cap_act_sta_cfi.id = le16_to_cpu(hw->cap_act_sta_cfi.id); |
839 | hw->cap_act_sta_cfi.variant = | 834 | hw->cap_act_sta_cfi.variant = le16_to_cpu(hw->cap_act_sta_cfi.variant); |
840 | le16_to_cpu(hw->cap_act_sta_cfi.variant); | 835 | hw->cap_act_sta_cfi.bottom = le16_to_cpu(hw->cap_act_sta_cfi.bottom); |
841 | hw->cap_act_sta_cfi.bottom = | ||
842 | le16_to_cpu(hw->cap_act_sta_cfi.bottom); | ||
843 | hw->cap_act_sta_cfi.top = le16_to_cpu(hw->cap_act_sta_cfi.top); | 836 | hw->cap_act_sta_cfi.top = le16_to_cpu(hw->cap_act_sta_cfi.top); |
844 | 837 | ||
845 | printk(KERN_INFO | 838 | printk(KERN_INFO |
@@ -861,10 +854,8 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) | |||
861 | fields in byte order */ | 854 | fields in byte order */ |
862 | hw->cap_act_sta_mfi.role = le16_to_cpu(hw->cap_act_sta_mfi.role); | 855 | hw->cap_act_sta_mfi.role = le16_to_cpu(hw->cap_act_sta_mfi.role); |
863 | hw->cap_act_sta_mfi.id = le16_to_cpu(hw->cap_act_sta_mfi.id); | 856 | hw->cap_act_sta_mfi.id = le16_to_cpu(hw->cap_act_sta_mfi.id); |
864 | hw->cap_act_sta_mfi.variant = | 857 | hw->cap_act_sta_mfi.variant = le16_to_cpu(hw->cap_act_sta_mfi.variant); |
865 | le16_to_cpu(hw->cap_act_sta_mfi.variant); | 858 | hw->cap_act_sta_mfi.bottom = le16_to_cpu(hw->cap_act_sta_mfi.bottom); |
866 | hw->cap_act_sta_mfi.bottom = | ||
867 | le16_to_cpu(hw->cap_act_sta_mfi.bottom); | ||
868 | hw->cap_act_sta_mfi.top = le16_to_cpu(hw->cap_act_sta_mfi.top); | 859 | hw->cap_act_sta_mfi.top = le16_to_cpu(hw->cap_act_sta_mfi.top); |
869 | 860 | ||
870 | printk(KERN_INFO | 861 | printk(KERN_INFO |
@@ -940,7 +931,7 @@ done: | |||
940 | * Call context: | 931 | * Call context: |
941 | * process thread | 932 | * process thread |
942 | ----------------------------------------------------------------*/ | 933 | ----------------------------------------------------------------*/ |
943 | static int prism2sta_globalsetup(wlandevice_t *wlandev) | 934 | static int prism2sta_globalsetup(wlandevice_t * wlandev) |
944 | { | 935 | { |
945 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 936 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
946 | 937 | ||
@@ -949,7 +940,7 @@ static int prism2sta_globalsetup(wlandevice_t *wlandev) | |||
949 | WLAN_DATA_MAXLEN); | 940 | WLAN_DATA_MAXLEN); |
950 | } | 941 | } |
951 | 942 | ||
952 | static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev) | 943 | static int prism2sta_setmulticast(wlandevice_t * wlandev, netdevice_t * dev) |
953 | { | 944 | { |
954 | int result = 0; | 945 | int result = 0; |
955 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 946 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
@@ -990,8 +981,8 @@ exit: | |||
990 | * Call context: | 981 | * Call context: |
991 | * interrupt | 982 | * interrupt |
992 | ----------------------------------------------------------------*/ | 983 | ----------------------------------------------------------------*/ |
993 | static void prism2sta_inf_handover(wlandevice_t *wlandev, | 984 | static void prism2sta_inf_handover(wlandevice_t * wlandev, |
994 | hfa384x_InfFrame_t *inf) | 985 | hfa384x_InfFrame_t * inf) |
995 | { | 986 | { |
996 | pr_debug("received infoframe:HANDOVER (unhandled)\n"); | 987 | pr_debug("received infoframe:HANDOVER (unhandled)\n"); |
997 | return; | 988 | return; |
@@ -1014,8 +1005,8 @@ static void prism2sta_inf_handover(wlandevice_t *wlandev, | |||
1014 | * Call context: | 1005 | * Call context: |
1015 | * interrupt | 1006 | * interrupt |
1016 | ----------------------------------------------------------------*/ | 1007 | ----------------------------------------------------------------*/ |
1017 | static void prism2sta_inf_tallies(wlandevice_t *wlandev, | 1008 | static void prism2sta_inf_tallies(wlandevice_t * wlandev, |
1018 | hfa384x_InfFrame_t *inf) | 1009 | hfa384x_InfFrame_t * inf) |
1019 | { | 1010 | { |
1020 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 1011 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
1021 | u16 *src16; | 1012 | u16 *src16; |
@@ -1031,13 +1022,13 @@ static void prism2sta_inf_tallies(wlandevice_t *wlandev, | |||
1031 | 1022 | ||
1032 | cnt = sizeof(hfa384x_CommTallies32_t) / sizeof(u32); | 1023 | cnt = sizeof(hfa384x_CommTallies32_t) / sizeof(u32); |
1033 | if (inf->framelen > 22) { | 1024 | if (inf->framelen > 22) { |
1034 | dst = (u32 *)&hw->tallies; | 1025 | dst = (u32 *) & hw->tallies; |
1035 | src32 = (u32 *)&inf->info.commtallies32; | 1026 | src32 = (u32 *) & inf->info.commtallies32; |
1036 | for (i = 0; i < cnt; i++, dst++, src32++) | 1027 | for (i = 0; i < cnt; i++, dst++, src32++) |
1037 | *dst += le32_to_cpu(*src32); | 1028 | *dst += le32_to_cpu(*src32); |
1038 | } else { | 1029 | } else { |
1039 | dst = (u32 *)&hw->tallies; | 1030 | dst = (u32 *) & hw->tallies; |
1040 | src16 = (u16 *)&inf->info.commtallies16; | 1031 | src16 = (u16 *) & inf->info.commtallies16; |
1041 | for (i = 0; i < cnt; i++, dst++, src16++) | 1032 | for (i = 0; i < cnt; i++, dst++, src16++) |
1042 | *dst += le16_to_cpu(*src16); | 1033 | *dst += le16_to_cpu(*src16); |
1043 | } | 1034 | } |
@@ -1062,8 +1053,8 @@ static void prism2sta_inf_tallies(wlandevice_t *wlandev, | |||
1062 | * Call context: | 1053 | * Call context: |
1063 | * interrupt | 1054 | * interrupt |
1064 | ----------------------------------------------------------------*/ | 1055 | ----------------------------------------------------------------*/ |
1065 | static void prism2sta_inf_scanresults(wlandevice_t *wlandev, | 1056 | static void prism2sta_inf_scanresults(wlandevice_t * wlandev, |
1066 | hfa384x_InfFrame_t *inf) | 1057 | hfa384x_InfFrame_t * inf) |
1067 | { | 1058 | { |
1068 | 1059 | ||
1069 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 1060 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
@@ -1080,14 +1071,14 @@ static void prism2sta_inf_scanresults(wlandevice_t *wlandev, | |||
1080 | 1071 | ||
1081 | /* Print em */ | 1072 | /* Print em */ |
1082 | pr_debug("rx scanresults, reason=%d, nbss=%d:\n", | 1073 | pr_debug("rx scanresults, reason=%d, nbss=%d:\n", |
1083 | inf->info.scanresult.scanreason, nbss); | 1074 | inf->info.scanresult.scanreason, nbss); |
1084 | for (i = 0; i < nbss; i++) { | 1075 | for (i = 0; i < nbss; i++) { |
1085 | pr_debug("chid=%d anl=%d sl=%d bcnint=%d\n", | 1076 | pr_debug("chid=%d anl=%d sl=%d bcnint=%d\n", |
1086 | sr->result[i].chid, | 1077 | sr->result[i].chid, |
1087 | sr->result[i].anl, | 1078 | sr->result[i].anl, |
1088 | sr->result[i].sl, sr->result[i].bcnint); | 1079 | sr->result[i].sl, sr->result[i].bcnint); |
1089 | pr_debug(" capinfo=0x%04x proberesp_rate=%d\n", | 1080 | pr_debug(" capinfo=0x%04x proberesp_rate=%d\n", |
1090 | sr->result[i].capinfo, sr->result[i].proberesp_rate); | 1081 | sr->result[i].capinfo, sr->result[i].proberesp_rate); |
1091 | } | 1082 | } |
1092 | /* issue a join request */ | 1083 | /* issue a join request */ |
1093 | joinreq.channel = sr->result[0].chid; | 1084 | joinreq.channel = sr->result[0].chid; |
@@ -1120,8 +1111,8 @@ static void prism2sta_inf_scanresults(wlandevice_t *wlandev, | |||
1120 | * Call context: | 1111 | * Call context: |
1121 | * interrupt | 1112 | * interrupt |
1122 | ----------------------------------------------------------------*/ | 1113 | ----------------------------------------------------------------*/ |
1123 | static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev, | 1114 | static void prism2sta_inf_hostscanresults(wlandevice_t * wlandev, |
1124 | hfa384x_InfFrame_t *inf) | 1115 | hfa384x_InfFrame_t * inf) |
1125 | { | 1116 | { |
1126 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 1117 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
1127 | int nbss; | 1118 | int nbss; |
@@ -1162,8 +1153,8 @@ static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev, | |||
1162 | * Call context: | 1153 | * Call context: |
1163 | * interrupt | 1154 | * interrupt |
1164 | ----------------------------------------------------------------*/ | 1155 | ----------------------------------------------------------------*/ |
1165 | static void prism2sta_inf_chinforesults(wlandevice_t *wlandev, | 1156 | static void prism2sta_inf_chinforesults(wlandevice_t * wlandev, |
1166 | hfa384x_InfFrame_t *inf) | 1157 | hfa384x_InfFrame_t * inf) |
1167 | { | 1158 | { |
1168 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 1159 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
1169 | unsigned int i, n; | 1160 | unsigned int i, n; |
@@ -1174,29 +1165,26 @@ static void prism2sta_inf_chinforesults(wlandevice_t *wlandev, | |||
1174 | for (i = 0, n = 0; i < HFA384x_CHINFORESULT_MAX; i++) { | 1165 | for (i = 0, n = 0; i < HFA384x_CHINFORESULT_MAX; i++) { |
1175 | if (hw->channel_info.results.scanchannels & (1 << i)) { | 1166 | if (hw->channel_info.results.scanchannels & (1 << i)) { |
1176 | int channel = | 1167 | int channel = |
1177 | le16_to_cpu(inf->info.chinforesult.result[n]. | 1168 | le16_to_cpu(inf->info.chinforesult.result[n].chid) - |
1178 | chid) - 1; | 1169 | 1; |
1179 | hfa384x_ChInfoResultSub_t *chinforesult = | 1170 | hfa384x_ChInfoResultSub_t *chinforesult = |
1180 | &hw->channel_info.results.result[channel]; | 1171 | &hw->channel_info.results.result[channel]; |
1181 | chinforesult->chid = channel; | 1172 | chinforesult->chid = channel; |
1182 | chinforesult->anl = | 1173 | chinforesult->anl = |
1183 | le16_to_cpu(inf->info.chinforesult.result[n]. | 1174 | le16_to_cpu(inf->info.chinforesult.result[n].anl); |
1184 | anl); | ||
1185 | chinforesult->pnl = | 1175 | chinforesult->pnl = |
1186 | le16_to_cpu(inf->info.chinforesult.result[n]. | 1176 | le16_to_cpu(inf->info.chinforesult.result[n].pnl); |
1187 | pnl); | ||
1188 | chinforesult->active = | 1177 | chinforesult->active = |
1189 | le16_to_cpu(inf->info.chinforesult.result[n]. | 1178 | le16_to_cpu(inf->info.chinforesult.result[n]. |
1190 | active); | 1179 | active); |
1191 | pr_debug( | 1180 | pr_debug |
1192 | "chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n", | 1181 | ("chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n", |
1193 | channel + 1, | 1182 | channel + 1, |
1194 | chinforesult-> | 1183 | chinforesult-> |
1195 | active & HFA384x_CHINFORESULT_BSSACTIVE ? | 1184 | active & HFA384x_CHINFORESULT_BSSACTIVE ? "signal" |
1196 | "signal" : "noise", chinforesult->anl, | 1185 | : "noise", chinforesult->anl, chinforesult->pnl, |
1197 | chinforesult->pnl, | 1186 | chinforesult-> |
1198 | chinforesult-> | 1187 | active & HFA384x_CHINFORESULT_PCFACTIVE ? 1 : 0); |
1199 | active & HFA384x_CHINFORESULT_PCFACTIVE ? 1 : 0); | ||
1200 | n++; | 1188 | n++; |
1201 | } | 1189 | } |
1202 | } | 1190 | } |
@@ -1276,9 +1264,9 @@ void prism2sta_processing_defer(struct work_struct *data) | |||
1276 | wlandev->bssid, | 1264 | wlandev->bssid, |
1277 | WLAN_BSSID_LEN); | 1265 | WLAN_BSSID_LEN); |
1278 | if (result) { | 1266 | if (result) { |
1279 | pr_debug( | 1267 | pr_debug |
1280 | "getconfig(0x%02x) failed, result = %d\n", | 1268 | ("getconfig(0x%02x) failed, result = %d\n", |
1281 | HFA384x_RID_CURRENTBSSID, result); | 1269 | HFA384x_RID_CURRENTBSSID, result); |
1282 | goto failed; | 1270 | goto failed; |
1283 | } | 1271 | } |
1284 | 1272 | ||
@@ -1286,23 +1274,23 @@ void prism2sta_processing_defer(struct work_struct *data) | |||
1286 | HFA384x_RID_CURRENTSSID, | 1274 | HFA384x_RID_CURRENTSSID, |
1287 | &ssid, sizeof(ssid)); | 1275 | &ssid, sizeof(ssid)); |
1288 | if (result) { | 1276 | if (result) { |
1289 | pr_debug( | 1277 | pr_debug |
1290 | "getconfig(0x%02x) failed, result = %d\n", | 1278 | ("getconfig(0x%02x) failed, result = %d\n", |
1291 | HFA384x_RID_CURRENTSSID, result); | 1279 | HFA384x_RID_CURRENTSSID, result); |
1292 | goto failed; | 1280 | goto failed; |
1293 | } | 1281 | } |
1294 | prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid, | 1282 | prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) & ssid, |
1295 | (p80211pstrd_t *)&wlandev-> | 1283 | (p80211pstrd_t *) & |
1296 | ssid); | 1284 | wlandev->ssid); |
1297 | 1285 | ||
1298 | /* Collect the port status */ | 1286 | /* Collect the port status */ |
1299 | result = hfa384x_drvr_getconfig16(hw, | 1287 | result = hfa384x_drvr_getconfig16(hw, |
1300 | HFA384x_RID_PORTSTATUS, | 1288 | HFA384x_RID_PORTSTATUS, |
1301 | &portstatus); | 1289 | &portstatus); |
1302 | if (result) { | 1290 | if (result) { |
1303 | pr_debug( | 1291 | pr_debug |
1304 | "getconfig(0x%02x) failed, result = %d\n", | 1292 | ("getconfig(0x%02x) failed, result = %d\n", |
1305 | HFA384x_RID_PORTSTATUS, result); | 1293 | HFA384x_RID_PORTSTATUS, result); |
1306 | goto failed; | 1294 | goto failed; |
1307 | } | 1295 | } |
1308 | wlandev->macmode = | 1296 | wlandev->macmode = |
@@ -1366,9 +1354,8 @@ void prism2sta_processing_defer(struct work_struct *data) | |||
1366 | HFA384x_RID_CURRENTBSSID, | 1354 | HFA384x_RID_CURRENTBSSID, |
1367 | wlandev->bssid, WLAN_BSSID_LEN); | 1355 | wlandev->bssid, WLAN_BSSID_LEN); |
1368 | if (result) { | 1356 | if (result) { |
1369 | pr_debug( | 1357 | pr_debug("getconfig(0x%02x) failed, result = %d\n", |
1370 | "getconfig(0x%02x) failed, result = %d\n", | 1358 | HFA384x_RID_CURRENTBSSID, result); |
1371 | HFA384x_RID_CURRENTBSSID, result); | ||
1372 | goto failed; | 1359 | goto failed; |
1373 | } | 1360 | } |
1374 | 1361 | ||
@@ -1376,13 +1363,12 @@ void prism2sta_processing_defer(struct work_struct *data) | |||
1376 | HFA384x_RID_CURRENTSSID, | 1363 | HFA384x_RID_CURRENTSSID, |
1377 | &ssid, sizeof(ssid)); | 1364 | &ssid, sizeof(ssid)); |
1378 | if (result) { | 1365 | if (result) { |
1379 | pr_debug( | 1366 | pr_debug("getconfig(0x%02x) failed, result = %d\n", |
1380 | "getconfig(0x%02x) failed, result = %d\n", | 1367 | HFA384x_RID_CURRENTSSID, result); |
1381 | HFA384x_RID_CURRENTSSID, result); | ||
1382 | goto failed; | 1368 | goto failed; |
1383 | } | 1369 | } |
1384 | prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid, | 1370 | prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) & ssid, |
1385 | (p80211pstrd_t *)&wlandev->ssid); | 1371 | (p80211pstrd_t *) & wlandev->ssid); |
1386 | 1372 | ||
1387 | hw->link_status = HFA384x_LINK_CONNECTED; | 1373 | hw->link_status = HFA384x_LINK_CONNECTED; |
1388 | netif_carrier_on(wlandev->netdev); | 1374 | netif_carrier_on(wlandev->netdev); |
@@ -1482,8 +1468,8 @@ failed: | |||
1482 | * Call context: | 1468 | * Call context: |
1483 | * interrupt | 1469 | * interrupt |
1484 | ----------------------------------------------------------------*/ | 1470 | ----------------------------------------------------------------*/ |
1485 | static void prism2sta_inf_linkstatus(wlandevice_t *wlandev, | 1471 | static void prism2sta_inf_linkstatus(wlandevice_t * wlandev, |
1486 | hfa384x_InfFrame_t *inf) | 1472 | hfa384x_InfFrame_t * inf) |
1487 | { | 1473 | { |
1488 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 1474 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
1489 | 1475 | ||
@@ -1512,8 +1498,8 @@ static void prism2sta_inf_linkstatus(wlandevice_t *wlandev, | |||
1512 | * Call context: | 1498 | * Call context: |
1513 | * interrupt | 1499 | * interrupt |
1514 | ----------------------------------------------------------------*/ | 1500 | ----------------------------------------------------------------*/ |
1515 | static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, | 1501 | static void prism2sta_inf_assocstatus(wlandevice_t * wlandev, |
1516 | hfa384x_InfFrame_t *inf) | 1502 | hfa384x_InfFrame_t * inf) |
1517 | { | 1503 | { |
1518 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 1504 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
1519 | hfa384x_AssocStatus_t rec; | 1505 | hfa384x_AssocStatus_t rec; |
@@ -1574,8 +1560,8 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, | |||
1574 | * interrupt | 1560 | * interrupt |
1575 | * | 1561 | * |
1576 | ----------------------------------------------------------------*/ | 1562 | ----------------------------------------------------------------*/ |
1577 | static void prism2sta_inf_authreq(wlandevice_t *wlandev, | 1563 | static void prism2sta_inf_authreq(wlandevice_t * wlandev, |
1578 | hfa384x_InfFrame_t *inf) | 1564 | hfa384x_InfFrame_t * inf) |
1579 | { | 1565 | { |
1580 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 1566 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
1581 | struct sk_buff *skb; | 1567 | struct sk_buff *skb; |
@@ -1589,8 +1575,8 @@ static void prism2sta_inf_authreq(wlandevice_t *wlandev, | |||
1589 | } | 1575 | } |
1590 | } | 1576 | } |
1591 | 1577 | ||
1592 | static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev, | 1578 | static void prism2sta_inf_authreq_defer(wlandevice_t * wlandev, |
1593 | hfa384x_InfFrame_t *inf) | 1579 | hfa384x_InfFrame_t * inf) |
1594 | { | 1580 | { |
1595 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 1581 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
1596 | hfa384x_authenticateStation_data_t rec; | 1582 | hfa384x_authenticateStation_data_t rec; |
@@ -1763,8 +1749,8 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev, | |||
1763 | * Call context: | 1749 | * Call context: |
1764 | * interrupt | 1750 | * interrupt |
1765 | ----------------------------------------------------------------*/ | 1751 | ----------------------------------------------------------------*/ |
1766 | static void prism2sta_inf_psusercnt(wlandevice_t *wlandev, | 1752 | static void prism2sta_inf_psusercnt(wlandevice_t * wlandev, |
1767 | hfa384x_InfFrame_t *inf) | 1753 | hfa384x_InfFrame_t * inf) |
1768 | { | 1754 | { |
1769 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; | 1755 | hfa384x_t *hw = (hfa384x_t *) wlandev->priv; |
1770 | 1756 | ||
@@ -1790,7 +1776,7 @@ static void prism2sta_inf_psusercnt(wlandevice_t *wlandev, | |||
1790 | * Call context: | 1776 | * Call context: |
1791 | * interrupt | 1777 | * interrupt |
1792 | ----------------------------------------------------------------*/ | 1778 | ----------------------------------------------------------------*/ |
1793 | void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) | 1779 | void prism2sta_ev_info(wlandevice_t * wlandev, hfa384x_InfFrame_t * inf) |
1794 | { | 1780 | { |
1795 | inf->infotype = le16_to_cpu(inf->infotype); | 1781 | inf->infotype = le16_to_cpu(inf->infotype); |
1796 | /* Dispatch */ | 1782 | /* Dispatch */ |
@@ -1858,7 +1844,7 @@ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) | |||
1858 | * Call context: | 1844 | * Call context: |
1859 | * interrupt | 1845 | * interrupt |
1860 | ----------------------------------------------------------------*/ | 1846 | ----------------------------------------------------------------*/ |
1861 | void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status) | 1847 | void prism2sta_ev_txexc(wlandevice_t * wlandev, u16 status) |
1862 | { | 1848 | { |
1863 | pr_debug("TxExc status=0x%x.\n", status); | 1849 | pr_debug("TxExc status=0x%x.\n", status); |
1864 | 1850 | ||
@@ -1881,7 +1867,7 @@ void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status) | |||
1881 | * Call context: | 1867 | * Call context: |
1882 | * interrupt | 1868 | * interrupt |
1883 | ----------------------------------------------------------------*/ | 1869 | ----------------------------------------------------------------*/ |
1884 | void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status) | 1870 | void prism2sta_ev_tx(wlandevice_t * wlandev, u16 status) |
1885 | { | 1871 | { |
1886 | pr_debug("Tx Complete, status=0x%04x\n", status); | 1872 | pr_debug("Tx Complete, status=0x%04x\n", status); |
1887 | /* update linux network stats */ | 1873 | /* update linux network stats */ |
@@ -1905,7 +1891,7 @@ void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status) | |||
1905 | * Call context: | 1891 | * Call context: |
1906 | * interrupt | 1892 | * interrupt |
1907 | ----------------------------------------------------------------*/ | 1893 | ----------------------------------------------------------------*/ |
1908 | void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb) | 1894 | void prism2sta_ev_rx(wlandevice_t * wlandev, struct sk_buff *skb) |
1909 | { | 1895 | { |
1910 | p80211netdev_rx(wlandev, skb); | 1896 | p80211netdev_rx(wlandev, skb); |
1911 | return; | 1897 | return; |
@@ -1927,7 +1913,7 @@ void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb) | |||
1927 | * Call context: | 1913 | * Call context: |
1928 | * interrupt | 1914 | * interrupt |
1929 | ----------------------------------------------------------------*/ | 1915 | ----------------------------------------------------------------*/ |
1930 | void prism2sta_ev_alloc(wlandevice_t *wlandev) | 1916 | void prism2sta_ev_alloc(wlandevice_t * wlandev) |
1931 | { | 1917 | { |
1932 | netif_wake_queue(wlandev->netdev); | 1918 | netif_wake_queue(wlandev->netdev); |
1933 | return; | 1919 | return; |
@@ -2020,9 +2006,9 @@ void prism2sta_commsqual_defer(struct work_struct *data) | |||
2020 | } | 2006 | } |
2021 | 2007 | ||
2022 | pr_debug("commsqual %d %d %d\n", | 2008 | pr_debug("commsqual %d %d %d\n", |
2023 | le16_to_cpu(hw->qual.CQ_currBSS), | 2009 | le16_to_cpu(hw->qual.CQ_currBSS), |
2024 | le16_to_cpu(hw->qual.ASL_currBSS), | 2010 | le16_to_cpu(hw->qual.ASL_currBSS), |
2025 | le16_to_cpu(hw->qual.ANL_currFC)); | 2011 | le16_to_cpu(hw->qual.ANL_currFC)); |
2026 | } | 2012 | } |
2027 | 2013 | ||
2028 | /* Lastly, we need to make sure the BSSID didn't change on us */ | 2014 | /* Lastly, we need to make sure the BSSID didn't change on us */ |
@@ -2030,9 +2016,8 @@ void prism2sta_commsqual_defer(struct work_struct *data) | |||
2030 | HFA384x_RID_CURRENTBSSID, | 2016 | HFA384x_RID_CURRENTBSSID, |
2031 | wlandev->bssid, WLAN_BSSID_LEN); | 2017 | wlandev->bssid, WLAN_BSSID_LEN); |
2032 | if (result) { | 2018 | if (result) { |
2033 | pr_debug( | 2019 | pr_debug("getconfig(0x%02x) failed, result = %d\n", |
2034 | "getconfig(0x%02x) failed, result = %d\n", | 2020 | HFA384x_RID_CURRENTBSSID, result); |
2035 | HFA384x_RID_CURRENTBSSID, result); | ||
2036 | goto done; | 2021 | goto done; |
2037 | } | 2022 | } |
2038 | 2023 | ||
@@ -2040,13 +2025,12 @@ void prism2sta_commsqual_defer(struct work_struct *data) | |||
2040 | HFA384x_RID_CURRENTSSID, | 2025 | HFA384x_RID_CURRENTSSID, |
2041 | &ssid, sizeof(ssid)); | 2026 | &ssid, sizeof(ssid)); |
2042 | if (result) { | 2027 | if (result) { |
2043 | pr_debug( | 2028 | pr_debug("getconfig(0x%02x) failed, result = %d\n", |
2044 | "getconfig(0x%02x) failed, result = %d\n", | 2029 | HFA384x_RID_CURRENTSSID, result); |
2045 | HFA384x_RID_CURRENTSSID, result); | ||
2046 | goto done; | 2030 | goto done; |
2047 | } | 2031 | } |
2048 | prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid, | 2032 | prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) & ssid, |
2049 | (p80211pstrd_t *)&wlandev->ssid); | 2033 | (p80211pstrd_t *) & wlandev->ssid); |
2050 | 2034 | ||
2051 | /* Reschedule timer */ | 2035 | /* Reschedule timer */ |
2052 | mod_timer(&hw->commsqual_timer, jiffies + HZ); | 2036 | mod_timer(&hw->commsqual_timer, jiffies + HZ); |