1 /* src/prism2/driver/prism2sta.c
3 * Implements the station functionality for prism2
5 * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
6 * --------------------------------------------------------------------
10 * The contents of this file are subject to the Mozilla Public
11 * License Version 1.1 (the "License"); you may not use this file
12 * except in compliance with the License. You may obtain a copy of
13 * the License at http://www.mozilla.org/MPL/
15 * Software distributed under the License is distributed on an "AS
16 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17 * implied. See the License for the specific language governing
18 * rights and limitations under the License.
20 * Alternatively, the contents of this file may be used under the
21 * terms of the GNU Public License version 2 (the "GPL"), in which
22 * case the provisions of the GPL are applicable instead of the
23 * above. If you wish to allow the use of your version of this file
24 * only under the terms of the GPL and not to allow others to use
25 * your version of this file under the MPL, indicate your decision
26 * by deleting the provisions above and replace them with the notice
27 * and other provisions required by the GPL. If you do not delete
28 * the provisions above, a recipient may use your version of this
29 * file under either the MPL or the GPL.
31 * --------------------------------------------------------------------
33 * Inquiries regarding the linux-wlan Open Source project can be
36 * AbsoluteValue Systems Inc.
38 * http://www.linux-wlan.com
40 * --------------------------------------------------------------------
42 * Portions of the development of this software were funded by
43 * Intersil Corporation as part of PRISM(R) chipset product development.
45 * --------------------------------------------------------------------
47 * This file implements the module and linux pcmcia routines for the
50 * --------------------------------------------------------------------
53 /*================================================================*/
55 #define WLAN_DBVAR prism2_debug
60 #include <linux/version.h>
62 #include <linux/module.h>
63 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,25))
64 #include <linux/moduleparam.h>
67 #include <linux/kernel.h>
68 #include <linux/sched.h>
69 #include <linux/types.h>
70 #include <linux/init.h>
71 #include <linux/slab.h>
72 #include <linux/wireless.h>
73 #include <linux/netdevice.h>
75 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
76 #include <linux/tqueue.h>
78 #include <linux/workqueue.h>
82 #include <linux/delay.h>
83 #include <asm/byteorder.h>
84 #include <linux/if_arp.h>
86 #include "wlan_compat.h"
88 /*================================================================*/
89 /* Project Includes */
91 #include "p80211types.h"
92 #include "p80211hdr.h"
93 #include "p80211mgmt.h"
94 #include "p80211conv.h"
95 #include "p80211msg.h"
96 #include "p80211netdev.h"
97 #include "p80211req.h"
98 #include "p80211metadef.h"
99 #include "p80211metastruct.h"
101 #include "prism2mgmt.h"
103 /*================================================================*/
104 /* Local Constants */
106 /*================================================================*/
109 /*================================================================*/
112 /*================================================================*/
113 /* Local Static Definitions */
115 typedef char* dev_info_t;
117 static dev_info_t dev_info = "prism2_usb";
119 static wlandevice_t *create_wlan(void);
121 /*----------------------------------------------------------------*/
122 /* --Module Parameters */
124 int prism2_reset_holdtime=30; /* Reset hold time in ms */
125 int prism2_reset_settletime=100; /* Reset settle time in ms */
127 static int prism2_doreset=0; /* Do a reset at init? */
129 #ifdef WLAN_INCLUDE_DEBUG
131 module_param( prism2_debug, int, 0644);
132 MODULE_PARM_DESC(prism2_debug, "prism2 debugging");
135 module_param( prism2_doreset, int, 0644);
136 MODULE_PARM_DESC(prism2_doreset, "Issue a reset on initialization");
138 module_param( prism2_reset_holdtime, int, 0644);
139 MODULE_PARM_DESC( prism2_reset_holdtime, "reset hold time in ms");
140 module_param( prism2_reset_settletime, int, 0644);
141 MODULE_PARM_DESC( prism2_reset_settletime, "reset settle time in ms");
143 MODULE_LICENSE("Dual MPL/GPL");
145 /*================================================================*/
146 /* Local Function Declarations */
148 static int prism2sta_open(wlandevice_t *wlandev);
149 static int prism2sta_close(wlandevice_t *wlandev);
150 static void prism2sta_reset(wlandevice_t *wlandev );
151 static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep);
152 static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg);
153 static int prism2sta_getcardinfo(wlandevice_t *wlandev);
154 static int prism2sta_globalsetup(wlandevice_t *wlandev);
155 static int prism2sta_setmulticast(wlandevice_t *wlandev,
158 static void prism2sta_inf_handover(
159 wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
160 static void prism2sta_inf_tallies(
161 wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
162 static void prism2sta_inf_hostscanresults(
163 wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
164 static void prism2sta_inf_scanresults(
165 wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
166 static void prism2sta_inf_chinforesults(
167 wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
168 static void prism2sta_inf_linkstatus(
169 wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
170 static void prism2sta_inf_assocstatus(
171 wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
172 static void prism2sta_inf_authreq(
173 wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
174 static void prism2sta_inf_authreq_defer(
175 wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
176 static void prism2sta_inf_psusercnt(
177 wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
179 #ifdef CONFIG_PROC_FS
190 /*================================================================*/
191 /* Function Definitions */
193 /*----------------------------------------------------------------
196 * Debug utility function to dump memory to the kernel debug log.
199 * buf ptr data we want dumped
209 ----------------------------------------------------------------*/
210 inline void dmpmem(void *buf, int n)
213 for ( c= 0; c < n; c++) {
214 if ( (c % 16) == 0 ) printk(KERN_DEBUG"dmp[%d]: ", c);
215 printk("%02x ", ((UINT8*)buf)[c]);
216 if ( (c % 16) == 15 ) printk("\n");
218 if ( (c % 16) != 0 ) printk("\n");
222 /*----------------------------------------------------------------
225 * WLAN device open method. Called from p80211netdev when kernel
226 * device open (start) method is called in response to the
227 * SIOCSIIFFLAGS ioctl changing the flags bit IFF_UP
231 * wlandev wlan device structure
235 * >0 f/w reported error
236 * <0 driver reported error
242 ----------------------------------------------------------------*/
243 static int prism2sta_open(wlandevice_t *wlandev)
247 /* We don't currently have to do anything else.
248 * The setup of the MAC should be subsequently completed via
250 * Higher layers know we're ready from dev->start==1 and
251 * dev->tbusy==0. Our rx path knows to pass up received/
252 * frames because of dev->flags&IFF_UP is true.
260 /*----------------------------------------------------------------
263 * WLAN device close method. Called from p80211netdev when kernel
264 * device close method is called in response to the
265 * SIOCSIIFFLAGS ioctl changing the flags bit IFF_UP
269 * wlandev wlan device structure
273 * >0 f/w reported error
274 * <0 driver reported error
280 ----------------------------------------------------------------*/
281 static int prism2sta_close(wlandevice_t *wlandev)
285 /* We don't currently have to do anything else.
286 * Higher layers know we're not ready from dev->start==0 and
287 * dev->tbusy==1. Our rx path knows to not pass up received
288 * frames because of dev->flags&IFF_UP is false.
296 /*----------------------------------------------------------------
299 * Not currently implented.
302 * wlandev wlan device structure
312 ----------------------------------------------------------------*/
313 static void prism2sta_reset(wlandevice_t *wlandev )
321 /*----------------------------------------------------------------
324 * Takes a frame from p80211 and queues it for transmission.
327 * wlandev wlan device structure
328 * pb packet buffer struct. Contains an 802.11
330 * p80211_hdr points to the 802.11 header for the packet.
332 * 0 Success and more buffs available
333 * 1 Success but no more buffs
334 * 2 Allocation failure
335 * 4 Buffer full or queue busy
341 ----------------------------------------------------------------*/
342 static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb,
343 p80211_hdr_t *p80211_hdr,
344 p80211_metawep_t *p80211_wep)
346 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
350 /* If necessary, set the 802.11 WEP bit */
351 if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) {
352 p80211_hdr->a3.fc |= host2ieee16(WLAN_SET_FC_ISWEP(1));
355 result = hfa384x_drvr_txframe(hw, skb, p80211_hdr, p80211_wep);
362 /*----------------------------------------------------------------
363 * prism2sta_mlmerequest
365 * wlan command message handler. All we do here is pass the message
366 * over to the prism2sta_mgmt_handler.
369 * wlandev wlan device structure
370 * msg wlan command message
373 * <0 successful acceptance of message, but we're
374 * waiting for an async process to finish before
375 * we're done with the msg. When the asynch
376 * process is done, we'll call the p80211
377 * function p80211req_confirm() .
378 * >0 An error occurred while we were handling
385 ----------------------------------------------------------------*/
386 static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg)
388 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
393 switch( msg->msgcode )
395 case DIDmsg_dot11req_mibget :
396 WLAN_LOG_DEBUG(2,"Received mibget request\n");
397 result = prism2mgmt_mibset_mibget(wlandev, msg);
399 case DIDmsg_dot11req_mibset :
400 WLAN_LOG_DEBUG(2,"Received mibset request\n");
401 result = prism2mgmt_mibset_mibget(wlandev, msg);
403 case DIDmsg_dot11req_powermgmt :
404 WLAN_LOG_DEBUG(2,"Received powermgmt request\n");
405 result = prism2mgmt_powermgmt(wlandev, msg);
407 case DIDmsg_dot11req_scan :
408 WLAN_LOG_DEBUG(2,"Received scan request\n");
409 result = prism2mgmt_scan(wlandev, msg);
411 case DIDmsg_dot11req_scan_results :
412 WLAN_LOG_DEBUG(2,"Received scan_results request\n");
413 result = prism2mgmt_scan_results(wlandev, msg);
415 case DIDmsg_dot11req_join :
416 WLAN_LOG_DEBUG(2,"Received join request\n");
417 result = prism2mgmt_join(wlandev, msg);
419 case DIDmsg_dot11req_authenticate :
420 WLAN_LOG_DEBUG(2,"Received authenticate request\n");
421 result = prism2mgmt_authenticate(wlandev, msg);
423 case DIDmsg_dot11req_deauthenticate :
424 WLAN_LOG_DEBUG(2,"Received mlme deauthenticate request\n");
425 result = prism2mgmt_deauthenticate(wlandev, msg);
427 case DIDmsg_dot11req_associate :
428 WLAN_LOG_DEBUG(2,"Received mlme associate request\n");
429 result = prism2mgmt_associate(wlandev, msg);
431 case DIDmsg_dot11req_reassociate :
432 WLAN_LOG_DEBUG(2,"Received mlme reassociate request\n");
433 result = prism2mgmt_reassociate(wlandev, msg);
435 case DIDmsg_dot11req_disassociate :
436 WLAN_LOG_DEBUG(2,"Received mlme disassociate request\n");
437 result = prism2mgmt_disassociate(wlandev, msg);
439 case DIDmsg_dot11req_reset :
440 WLAN_LOG_DEBUG(2,"Received mlme reset request\n");
441 result = prism2mgmt_reset(wlandev, msg);
443 case DIDmsg_dot11req_start :
444 WLAN_LOG_DEBUG(2,"Received mlme start request\n");
445 result = prism2mgmt_start(wlandev, msg);
448 * Prism2 specific messages
450 case DIDmsg_p2req_join :
451 WLAN_LOG_DEBUG(2,"Received p2 join request\n");
452 result = prism2mgmt_p2_join(wlandev, msg);
454 case DIDmsg_p2req_readpda :
455 WLAN_LOG_DEBUG(2,"Received mlme readpda request\n");
456 result = prism2mgmt_readpda(wlandev, msg);
458 case DIDmsg_p2req_readcis :
459 WLAN_LOG_DEBUG(2,"Received mlme readcis request\n");
460 result = prism2mgmt_readcis(wlandev, msg);
462 case DIDmsg_p2req_auxport_state :
463 WLAN_LOG_DEBUG(2,"Received mlme auxport_state request\n");
464 result = prism2mgmt_auxport_state(wlandev, msg);
466 case DIDmsg_p2req_auxport_read :
467 WLAN_LOG_DEBUG(2,"Received mlme auxport_read request\n");
468 result = prism2mgmt_auxport_read(wlandev, msg);
470 case DIDmsg_p2req_auxport_write :
471 WLAN_LOG_DEBUG(2,"Received mlme auxport_write request\n");
472 result = prism2mgmt_auxport_write(wlandev, msg);
474 case DIDmsg_p2req_low_level :
475 WLAN_LOG_DEBUG(2,"Received mlme low_level request\n");
476 result = prism2mgmt_low_level(wlandev, msg);
478 case DIDmsg_p2req_test_command :
479 WLAN_LOG_DEBUG(2,"Received mlme test_command request\n");
480 result = prism2mgmt_test_command(wlandev, msg);
482 case DIDmsg_p2req_mmi_read :
483 WLAN_LOG_DEBUG(2,"Received mlme mmi_read request\n");
484 result = prism2mgmt_mmi_read(wlandev, msg);
486 case DIDmsg_p2req_mmi_write :
487 WLAN_LOG_DEBUG(2,"Received mlme mmi_write request\n");
488 result = prism2mgmt_mmi_write(wlandev, msg);
490 case DIDmsg_p2req_ramdl_state :
491 WLAN_LOG_DEBUG(2,"Received mlme ramdl_state request\n");
492 result = prism2mgmt_ramdl_state(wlandev, msg);
494 case DIDmsg_p2req_ramdl_write :
495 WLAN_LOG_DEBUG(2,"Received mlme ramdl_write request\n");
496 result = prism2mgmt_ramdl_write(wlandev, msg);
498 case DIDmsg_p2req_flashdl_state :
499 WLAN_LOG_DEBUG(2,"Received mlme flashdl_state request\n");
500 result = prism2mgmt_flashdl_state(wlandev, msg);
502 case DIDmsg_p2req_flashdl_write :
503 WLAN_LOG_DEBUG(2,"Received mlme flashdl_write request\n");
504 result = prism2mgmt_flashdl_write(wlandev, msg);
506 case DIDmsg_p2req_dump_state :
507 WLAN_LOG_DEBUG(2,"Received mlme dump_state request\n");
508 result = prism2mgmt_dump_state(wlandev, msg);
510 case DIDmsg_p2req_channel_info :
511 WLAN_LOG_DEBUG(2,"Received mlme channel_info request\n");
512 result = prism2mgmt_channel_info(wlandev, msg);
514 case DIDmsg_p2req_channel_info_results :
515 WLAN_LOG_DEBUG(2,"Received mlme channel_info_results request\n");
516 result = prism2mgmt_channel_info_results(wlandev, msg);
519 * Linux specific messages
521 case DIDmsg_lnxreq_hostwep :
523 case DIDmsg_lnxreq_ifstate :
525 p80211msg_lnxreq_ifstate_t *ifstatemsg;
526 WLAN_LOG_DEBUG(2,"Received mlme ifstate request\n");
527 ifstatemsg = (p80211msg_lnxreq_ifstate_t*)msg;
528 result = prism2sta_ifstate(wlandev, ifstatemsg->ifstate.data);
529 ifstatemsg->resultcode.status =
530 P80211ENUM_msgitem_status_data_ok;
531 ifstatemsg->resultcode.data = result;
535 case DIDmsg_lnxreq_wlansniff :
536 WLAN_LOG_DEBUG(2,"Received mlme wlansniff request\n");
537 result = prism2mgmt_wlansniff(wlandev, msg);
539 case DIDmsg_lnxreq_autojoin :
540 WLAN_LOG_DEBUG(2,"Received mlme autojoin request\n");
541 result = prism2mgmt_autojoin(wlandev, msg);
543 case DIDmsg_p2req_enable :
544 WLAN_LOG_DEBUG(2,"Received mlme enable request\n");
545 result = prism2mgmt_enable(wlandev, msg);
547 case DIDmsg_lnxreq_commsquality: {
548 p80211msg_lnxreq_commsquality_t *qualmsg;
550 WLAN_LOG_DEBUG(2,"Received commsquality request\n");
555 qualmsg = (p80211msg_lnxreq_commsquality_t*) msg;
557 qualmsg->link.status = P80211ENUM_msgitem_status_data_ok;
558 qualmsg->level.status = P80211ENUM_msgitem_status_data_ok;
559 qualmsg->noise.status = P80211ENUM_msgitem_status_data_ok;
562 qualmsg->link.data = hfa384x2host_16(hw->qual.CQ_currBSS);
563 qualmsg->level.data = hfa384x2host_16(hw->qual.ASL_currBSS);
564 qualmsg->noise.data = hfa384x2host_16(hw->qual.ANL_currFC);
569 WLAN_LOG_WARNING("Unknown mgmt request message 0x%08x", msg->msgcode);
578 /*----------------------------------------------------------------
581 * Interface state. This is the primary WLAN interface enable/disable
582 * handler. Following the driver/load/deviceprobe sequence, this
583 * function must be called with a state of "enable" before any other
584 * commands will be accepted.
587 * wlandev wlan device structure
588 * msgp ptr to msg buffer
591 * A p80211 message resultcode value.
596 * process thread (usually)
598 ----------------------------------------------------------------*/
599 UINT32 prism2sta_ifstate(wlandevice_t *wlandev, UINT32 ifstate)
601 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
605 result = P80211ENUM_resultcode_implementation_failure;
607 WLAN_LOG_DEBUG(2, "Current MSD state(%d), requesting(%d)\n",
608 wlandev->msdstate, ifstate);
611 case P80211ENUM_ifstate_fwload:
612 switch (wlandev->msdstate) {
613 case WLAN_MSD_HWPRESENT:
614 wlandev->msdstate = WLAN_MSD_FWLOAD_PENDING;
616 * Initialize the device+driver sufficiently
617 * for firmware loading.
619 if ((result=hfa384x_drvr_start(hw))) {
621 "hfa384x_drvr_start() failed,"
622 "result=%d\n", (int)result);
624 P80211ENUM_resultcode_implementation_failure;
625 wlandev->msdstate = WLAN_MSD_HWPRESENT;
628 wlandev->msdstate = WLAN_MSD_FWLOAD;
629 result = P80211ENUM_resultcode_success;
631 case WLAN_MSD_FWLOAD:
632 hfa384x_cmd_initialize(hw);
633 result = P80211ENUM_resultcode_success;
635 case WLAN_MSD_RUNNING:
637 "Cannot enter fwload state from enable state,"
638 "you must disable first.\n");
639 result = P80211ENUM_resultcode_invalid_parameters;
641 case WLAN_MSD_HWFAIL:
643 /* probe() had a problem or the msdstate contains
644 * an unrecognized value, there's nothing we can do.
646 result = P80211ENUM_resultcode_implementation_failure;
650 case P80211ENUM_ifstate_enable:
651 switch (wlandev->msdstate) {
652 case WLAN_MSD_HWPRESENT:
653 case WLAN_MSD_FWLOAD:
654 wlandev->msdstate = WLAN_MSD_RUNNING_PENDING;
655 /* Initialize the device+driver for full
656 * operation. Note that this might me an FWLOAD to
657 * to RUNNING transition so we must not do a chip
658 * or board level reset. Note that on failure,
659 * the MSD state is set to HWPRESENT because we
660 * can't make any assumptions about the state
661 * of the hardware or a previous firmware load.
663 if ((result=hfa384x_drvr_start(hw))) {
665 "hfa384x_drvr_start() failed,"
666 "result=%d\n", (int)result);
668 P80211ENUM_resultcode_implementation_failure;
669 wlandev->msdstate = WLAN_MSD_HWPRESENT;
673 if ((result=prism2sta_getcardinfo(wlandev))) {
675 "prism2sta_getcardinfo() failed,"
676 "result=%d\n", (int)result);
678 P80211ENUM_resultcode_implementation_failure;
679 hfa384x_drvr_stop(hw);
680 wlandev->msdstate = WLAN_MSD_HWPRESENT;
683 if ((result=prism2sta_globalsetup(wlandev))) {
685 "prism2sta_globalsetup() failed,"
686 "result=%d\n", (int)result);
688 P80211ENUM_resultcode_implementation_failure;
689 hfa384x_drvr_stop(hw);
690 wlandev->msdstate = WLAN_MSD_HWPRESENT;
693 wlandev->msdstate = WLAN_MSD_RUNNING;
695 hw->join_retries = 60;
696 result = P80211ENUM_resultcode_success;
698 case WLAN_MSD_RUNNING:
699 /* Do nothing, we're already in this state.*/
700 result = P80211ENUM_resultcode_success;
702 case WLAN_MSD_HWFAIL:
704 /* probe() had a problem or the msdstate contains
705 * an unrecognized value, there's nothing we can do.
707 result = P80211ENUM_resultcode_implementation_failure;
711 case P80211ENUM_ifstate_disable:
712 switch (wlandev->msdstate) {
713 case WLAN_MSD_HWPRESENT:
714 /* Do nothing, we're already in this state.*/
715 result = P80211ENUM_resultcode_success;
717 case WLAN_MSD_FWLOAD:
718 case WLAN_MSD_RUNNING:
719 wlandev->msdstate = WLAN_MSD_HWPRESENT_PENDING;
721 * TODO: Shut down the MAC completely. Here a chip
722 * or board level reset is probably called for.
723 * After a "disable" _all_ results are lost, even
724 * those from a fwload.
726 if (!wlandev->hwremoved)
727 netif_carrier_off(wlandev->netdev);
729 hfa384x_drvr_stop(hw);
731 wlandev->macmode = WLAN_MACMODE_NONE;
732 wlandev->msdstate = WLAN_MSD_HWPRESENT;
733 result = P80211ENUM_resultcode_success;
735 case WLAN_MSD_HWFAIL:
737 /* probe() had a problem or the msdstate contains
738 * an unrecognized value, there's nothing we can do.
740 result = P80211ENUM_resultcode_implementation_failure;
745 result = P80211ENUM_resultcode_invalid_parameters;
754 /*----------------------------------------------------------------
755 * prism2sta_getcardinfo
757 * Collect the NICID, firmware version and any other identifiers
758 * we'd like to have in host-side data structures.
761 * wlandev wlan device structure
765 * >0 f/w reported error
766 * <0 driver reported error
772 ----------------------------------------------------------------*/
773 static int prism2sta_getcardinfo(wlandevice_t *wlandev)
776 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
778 UINT8 snum[HFA384x_RID_NICSERIALNUMBER_LEN];
779 char pstr[(HFA384x_RID_NICSERIALNUMBER_LEN * 4) + 1];
783 /* Collect version and compatibility info */
784 /* Some are critical, some are not */
786 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_NICIDENTITY,
787 &hw->ident_nic, sizeof(hfa384x_compident_t));
789 WLAN_LOG_ERROR("Failed to retrieve NICIDENTITY\n");
793 /* get all the nic id fields in host byte order */
794 hw->ident_nic.id = hfa384x2host_16(hw->ident_nic.id);
795 hw->ident_nic.variant = hfa384x2host_16(hw->ident_nic.variant);
796 hw->ident_nic.major = hfa384x2host_16(hw->ident_nic.major);
797 hw->ident_nic.minor = hfa384x2host_16(hw->ident_nic.minor);
799 WLAN_LOG_INFO( "ident: nic h/w: id=0x%02x %d.%d.%d\n",
800 hw->ident_nic.id, hw->ident_nic.major,
801 hw->ident_nic.minor, hw->ident_nic.variant);
803 /* Primary f/w identity */
804 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRIIDENTITY,
805 &hw->ident_pri_fw, sizeof(hfa384x_compident_t));
807 WLAN_LOG_ERROR("Failed to retrieve PRIIDENTITY\n");
811 /* get all the private fw id fields in host byte order */
812 hw->ident_pri_fw.id = hfa384x2host_16(hw->ident_pri_fw.id);
813 hw->ident_pri_fw.variant = hfa384x2host_16(hw->ident_pri_fw.variant);
814 hw->ident_pri_fw.major = hfa384x2host_16(hw->ident_pri_fw.major);
815 hw->ident_pri_fw.minor = hfa384x2host_16(hw->ident_pri_fw.minor);
817 WLAN_LOG_INFO( "ident: pri f/w: id=0x%02x %d.%d.%d\n",
818 hw->ident_pri_fw.id, hw->ident_pri_fw.major,
819 hw->ident_pri_fw.minor, hw->ident_pri_fw.variant);
821 /* Station (Secondary?) f/w identity */
822 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STAIDENTITY,
823 &hw->ident_sta_fw, sizeof(hfa384x_compident_t));
825 WLAN_LOG_ERROR("Failed to retrieve STAIDENTITY\n");
829 if (hw->ident_nic.id < 0x8000) {
830 WLAN_LOG_ERROR("FATAL: Card is not an Intersil Prism2/2.5/3\n");
835 /* get all the station fw id fields in host byte order */
836 hw->ident_sta_fw.id = hfa384x2host_16(hw->ident_sta_fw.id);
837 hw->ident_sta_fw.variant = hfa384x2host_16(hw->ident_sta_fw.variant);
838 hw->ident_sta_fw.major = hfa384x2host_16(hw->ident_sta_fw.major);
839 hw->ident_sta_fw.minor = hfa384x2host_16(hw->ident_sta_fw.minor);
841 /* strip out the 'special' variant bits */
842 hw->mm_mods = hw->ident_sta_fw.variant & (BIT14 | BIT15);
843 hw->ident_sta_fw.variant &= ~((UINT16)(BIT14 | BIT15));
845 if ( hw->ident_sta_fw.id == 0x1f ) {
848 "ident: sta f/w: id=0x%02x %d.%d.%d\n",
849 hw->ident_sta_fw.id, hw->ident_sta_fw.major,
850 hw->ident_sta_fw.minor, hw->ident_sta_fw.variant);
854 "ident: ap f/w: id=0x%02x %d.%d.%d\n",
855 hw->ident_sta_fw.id, hw->ident_sta_fw.major,
856 hw->ident_sta_fw.minor, hw->ident_sta_fw.variant);
859 /* Compatibility range, Modem supplier */
860 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_MFISUPRANGE,
861 &hw->cap_sup_mfi, sizeof(hfa384x_caplevel_t));
863 WLAN_LOG_ERROR("Failed to retrieve MFISUPRANGE\n");
867 /* get all the Compatibility range, modem interface supplier
868 fields in byte order */
869 hw->cap_sup_mfi.role = hfa384x2host_16(hw->cap_sup_mfi.role);
870 hw->cap_sup_mfi.id = hfa384x2host_16(hw->cap_sup_mfi.id);
871 hw->cap_sup_mfi.variant = hfa384x2host_16(hw->cap_sup_mfi.variant);
872 hw->cap_sup_mfi.bottom = hfa384x2host_16(hw->cap_sup_mfi.bottom);
873 hw->cap_sup_mfi.top = hfa384x2host_16(hw->cap_sup_mfi.top);
876 "MFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
877 hw->cap_sup_mfi.role, hw->cap_sup_mfi.id,
878 hw->cap_sup_mfi.variant, hw->cap_sup_mfi.bottom,
879 hw->cap_sup_mfi.top);
881 /* Compatibility range, Controller supplier */
882 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CFISUPRANGE,
883 &hw->cap_sup_cfi, sizeof(hfa384x_caplevel_t));
885 WLAN_LOG_ERROR("Failed to retrieve CFISUPRANGE\n");
889 /* get all the Compatibility range, controller interface supplier
890 fields in byte order */
891 hw->cap_sup_cfi.role = hfa384x2host_16(hw->cap_sup_cfi.role);
892 hw->cap_sup_cfi.id = hfa384x2host_16(hw->cap_sup_cfi.id);
893 hw->cap_sup_cfi.variant = hfa384x2host_16(hw->cap_sup_cfi.variant);
894 hw->cap_sup_cfi.bottom = hfa384x2host_16(hw->cap_sup_cfi.bottom);
895 hw->cap_sup_cfi.top = hfa384x2host_16(hw->cap_sup_cfi.top);
898 "CFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
899 hw->cap_sup_cfi.role, hw->cap_sup_cfi.id,
900 hw->cap_sup_cfi.variant, hw->cap_sup_cfi.bottom,
901 hw->cap_sup_cfi.top);
903 /* Compatibility range, Primary f/w supplier */
904 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRISUPRANGE,
905 &hw->cap_sup_pri, sizeof(hfa384x_caplevel_t));
907 WLAN_LOG_ERROR("Failed to retrieve PRISUPRANGE\n");
911 /* get all the Compatibility range, primary firmware supplier
912 fields in byte order */
913 hw->cap_sup_pri.role = hfa384x2host_16(hw->cap_sup_pri.role);
914 hw->cap_sup_pri.id = hfa384x2host_16(hw->cap_sup_pri.id);
915 hw->cap_sup_pri.variant = hfa384x2host_16(hw->cap_sup_pri.variant);
916 hw->cap_sup_pri.bottom = hfa384x2host_16(hw->cap_sup_pri.bottom);
917 hw->cap_sup_pri.top = hfa384x2host_16(hw->cap_sup_pri.top);
920 "PRI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
921 hw->cap_sup_pri.role, hw->cap_sup_pri.id,
922 hw->cap_sup_pri.variant, hw->cap_sup_pri.bottom,
923 hw->cap_sup_pri.top);
925 /* Compatibility range, Station f/w supplier */
926 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STASUPRANGE,
927 &hw->cap_sup_sta, sizeof(hfa384x_caplevel_t));
929 WLAN_LOG_ERROR("Failed to retrieve STASUPRANGE\n");
933 /* get all the Compatibility range, station firmware supplier
934 fields in byte order */
935 hw->cap_sup_sta.role = hfa384x2host_16(hw->cap_sup_sta.role);
936 hw->cap_sup_sta.id = hfa384x2host_16(hw->cap_sup_sta.id);
937 hw->cap_sup_sta.variant = hfa384x2host_16(hw->cap_sup_sta.variant);
938 hw->cap_sup_sta.bottom = hfa384x2host_16(hw->cap_sup_sta.bottom);
939 hw->cap_sup_sta.top = hfa384x2host_16(hw->cap_sup_sta.top);
941 if ( hw->cap_sup_sta.id == 0x04 ) {
943 "STA:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
944 hw->cap_sup_sta.role, hw->cap_sup_sta.id,
945 hw->cap_sup_sta.variant, hw->cap_sup_sta.bottom,
946 hw->cap_sup_sta.top);
949 "AP:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
950 hw->cap_sup_sta.role, hw->cap_sup_sta.id,
951 hw->cap_sup_sta.variant, hw->cap_sup_sta.bottom,
952 hw->cap_sup_sta.top);
955 /* Compatibility range, primary f/w actor, CFI supplier */
956 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_PRI_CFIACTRANGES,
957 &hw->cap_act_pri_cfi, sizeof(hfa384x_caplevel_t));
959 WLAN_LOG_ERROR("Failed to retrieve PRI_CFIACTRANGES\n");
963 /* get all the Compatibility range, primary f/w actor, CFI supplier
964 fields in byte order */
965 hw->cap_act_pri_cfi.role = hfa384x2host_16(hw->cap_act_pri_cfi.role);
966 hw->cap_act_pri_cfi.id = hfa384x2host_16(hw->cap_act_pri_cfi.id);
967 hw->cap_act_pri_cfi.variant = hfa384x2host_16(hw->cap_act_pri_cfi.variant);
968 hw->cap_act_pri_cfi.bottom = hfa384x2host_16(hw->cap_act_pri_cfi.bottom);
969 hw->cap_act_pri_cfi.top = hfa384x2host_16(hw->cap_act_pri_cfi.top);
972 "PRI-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
973 hw->cap_act_pri_cfi.role, hw->cap_act_pri_cfi.id,
974 hw->cap_act_pri_cfi.variant, hw->cap_act_pri_cfi.bottom,
975 hw->cap_act_pri_cfi.top);
977 /* Compatibility range, sta f/w actor, CFI supplier */
978 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STA_CFIACTRANGES,
979 &hw->cap_act_sta_cfi, sizeof(hfa384x_caplevel_t));
981 WLAN_LOG_ERROR("Failed to retrieve STA_CFIACTRANGES\n");
985 /* get all the Compatibility range, station f/w actor, CFI supplier
986 fields in byte order */
987 hw->cap_act_sta_cfi.role = hfa384x2host_16(hw->cap_act_sta_cfi.role);
988 hw->cap_act_sta_cfi.id = hfa384x2host_16(hw->cap_act_sta_cfi.id);
989 hw->cap_act_sta_cfi.variant = hfa384x2host_16(hw->cap_act_sta_cfi.variant);
990 hw->cap_act_sta_cfi.bottom = hfa384x2host_16(hw->cap_act_sta_cfi.bottom);
991 hw->cap_act_sta_cfi.top = hfa384x2host_16(hw->cap_act_sta_cfi.top);
994 "STA-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
995 hw->cap_act_sta_cfi.role, hw->cap_act_sta_cfi.id,
996 hw->cap_act_sta_cfi.variant, hw->cap_act_sta_cfi.bottom,
997 hw->cap_act_sta_cfi.top);
999 /* Compatibility range, sta f/w actor, MFI supplier */
1000 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_STA_MFIACTRANGES,
1001 &hw->cap_act_sta_mfi, sizeof(hfa384x_caplevel_t));
1003 WLAN_LOG_ERROR("Failed to retrieve STA_MFIACTRANGES\n");
1007 /* get all the Compatibility range, station f/w actor, MFI supplier
1008 fields in byte order */
1009 hw->cap_act_sta_mfi.role = hfa384x2host_16(hw->cap_act_sta_mfi.role);
1010 hw->cap_act_sta_mfi.id = hfa384x2host_16(hw->cap_act_sta_mfi.id);
1011 hw->cap_act_sta_mfi.variant = hfa384x2host_16(hw->cap_act_sta_mfi.variant);
1012 hw->cap_act_sta_mfi.bottom = hfa384x2host_16(hw->cap_act_sta_mfi.bottom);
1013 hw->cap_act_sta_mfi.top = hfa384x2host_16(hw->cap_act_sta_mfi.top);
1016 "STA-MFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
1017 hw->cap_act_sta_mfi.role, hw->cap_act_sta_mfi.id,
1018 hw->cap_act_sta_mfi.variant, hw->cap_act_sta_mfi.bottom,
1019 hw->cap_act_sta_mfi.top);
1022 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_NICSERIALNUMBER,
1023 snum, HFA384x_RID_NICSERIALNUMBER_LEN);
1025 wlan_mkprintstr(snum, HFA384x_RID_NICSERIALNUMBER_LEN,
1026 pstr, sizeof(pstr));
1027 WLAN_LOG_INFO("Prism2 card SN: %s\n", pstr);
1029 WLAN_LOG_ERROR("Failed to retrieve Prism2 Card SN\n");
1033 /* Collect the MAC address */
1034 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFOWNMACADDR,
1035 wlandev->netdev->dev_addr, WLAN_ADDR_LEN);
1036 if ( result != 0 ) {
1037 WLAN_LOG_ERROR("Failed to retrieve mac address\n");
1041 /* short preamble is always implemented */
1042 wlandev->nsdcaps |= P80211_NSDCAP_SHORT_PREAMBLE;
1044 /* find out if hardware wep is implemented */
1045 hfa384x_drvr_getconfig16(hw, HFA384x_RID_PRIVACYOPTIMP, &temp);
1047 wlandev->nsdcaps |= P80211_NSDCAP_HARDWAREWEP;
1049 /* get the dBm Scaling constant */
1050 hfa384x_drvr_getconfig16(hw, HFA384x_RID_CNFDBMADJUST, &temp);
1051 hw->dbmadjust = temp;
1053 /* Only enable scan by default on newer firmware */
1054 if (HFA384x_FIRMWARE_VERSION(hw->ident_sta_fw.major,
1055 hw->ident_sta_fw.minor,
1056 hw->ident_sta_fw.variant) <
1057 HFA384x_FIRMWARE_VERSION(1,5,5)) {
1058 wlandev->nsdcaps |= P80211_NSDCAP_NOSCAN;
1061 /* TODO: Set any internally managed config items */
1065 WLAN_LOG_ERROR("Failed, result=%d\n", result);
1072 /*----------------------------------------------------------------
1073 * prism2sta_globalsetup
1075 * Set any global RIDs that we want to set at device activation.
1078 * wlandev wlan device structure
1082 * >0 f/w reported error
1083 * <0 driver reported error
1089 ----------------------------------------------------------------*/
1090 static int prism2sta_globalsetup(wlandevice_t *wlandev)
1092 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1094 /* Set the maximum frame size */
1095 return hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFMAXDATALEN,
1099 static int prism2sta_setmulticast(wlandevice_t *wlandev, netdevice_t *dev)
1102 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1108 /* If we're not ready, what's the point? */
1109 if ( hw->state != HFA384x_STATE_RUNNING )
1112 /* If we're an AP, do nothing here */
1116 if ( (dev->flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0 )
1117 promisc = P80211ENUM_truth_true;
1119 promisc = P80211ENUM_truth_false;
1121 result = hfa384x_drvr_setconfig16_async(hw, HFA384x_RID_PROMISCMODE, promisc);
1123 /* XXX TODO: configure the multicast list */
1124 // CLEAR_HW_MULTICAST_LIST
1125 // struct dev_mc_list element = dev->mc_list;
1126 // while (element != null) {
1127 // HW_ADD_MULTICAST_ADDR(element->dmi_addr, dmi_addrlen)
1128 // element = element->next;
1136 /*----------------------------------------------------------------
1137 * prism2sta_inf_handover
1139 * Handles the receipt of a Handover info frame. Should only be present
1143 * wlandev wlan device structure
1144 * inf ptr to info frame (contents in hfa384x order)
1153 ----------------------------------------------------------------*/
1154 static void prism2sta_inf_handover(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
1157 WLAN_LOG_DEBUG(2,"received infoframe:HANDOVER (unhandled)\n");
1163 /*----------------------------------------------------------------
1164 * prism2sta_inf_tallies
1166 * Handles the receipt of a CommTallies info frame.
1169 * wlandev wlan device structure
1170 * inf ptr to info frame (contents in hfa384x order)
1179 ----------------------------------------------------------------*/
1180 static void prism2sta_inf_tallies(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
1182 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1192 ** Determine if these are 16-bit or 32-bit tallies, based on the
1193 ** record length of the info record.
1196 cnt = sizeof(hfa384x_CommTallies32_t) / sizeof(UINT32);
1197 if (inf->framelen > 22) {
1198 dst = (UINT32 *) &hw->tallies;
1199 src32 = (UINT32 *) &inf->info.commtallies32;
1200 for (i = 0; i < cnt; i++, dst++, src32++)
1201 *dst += hfa384x2host_32(*src32);
1203 dst = (UINT32 *) &hw->tallies;
1204 src16 = (UINT16 *) &inf->info.commtallies16;
1205 for (i = 0; i < cnt; i++, dst++, src16++)
1206 *dst += hfa384x2host_16(*src16);
1214 /*----------------------------------------------------------------
1215 * prism2sta_inf_scanresults
1217 * Handles the receipt of a Scan Results info frame.
1220 * wlandev wlan device structure
1221 * inf ptr to info frame (contents in hfa384x order)
1230 ----------------------------------------------------------------*/
1231 static void prism2sta_inf_scanresults(wlandevice_t *wlandev,
1232 hfa384x_InfFrame_t *inf)
1235 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1237 hfa384x_ScanResult_t *sr = &(inf->info.scanresult);
1239 hfa384x_JoinRequest_data_t joinreq;
1243 /* Get the number of results, first in bytes, then in results */
1244 nbss = (inf->framelen * sizeof(UINT16)) -
1245 sizeof(inf->infotype) -
1246 sizeof(inf->info.scanresult.scanreason);
1247 nbss /= sizeof(hfa384x_ScanResultSub_t);
1250 WLAN_LOG_DEBUG(1,"rx scanresults, reason=%d, nbss=%d:\n",
1251 inf->info.scanresult.scanreason, nbss);
1252 for ( i = 0; i < nbss; i++) {
1253 WLAN_LOG_DEBUG(1, "chid=%d anl=%d sl=%d bcnint=%d\n",
1257 sr->result[i].bcnint);
1258 WLAN_LOG_DEBUG(1, " capinfo=0x%04x proberesp_rate=%d\n",
1259 sr->result[i].capinfo,
1260 sr->result[i].proberesp_rate);
1262 /* issue a join request */
1263 joinreq.channel = sr->result[0].chid;
1264 memcpy( joinreq.bssid, sr->result[0].bssid, WLAN_BSSID_LEN);
1265 result = hfa384x_drvr_setconfig( hw,
1266 HFA384x_RID_JOINREQUEST,
1267 &joinreq, HFA384x_RID_JOINREQUEST_LEN);
1269 WLAN_LOG_ERROR("setconfig(joinreq) failed, result=%d\n", result);
1276 /*----------------------------------------------------------------
1277 * prism2sta_inf_hostscanresults
1279 * Handles the receipt of a Scan Results info frame.
1282 * wlandev wlan device structure
1283 * inf ptr to info frame (contents in hfa384x order)
1292 ----------------------------------------------------------------*/
1293 static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev,
1294 hfa384x_InfFrame_t *inf)
1296 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1300 nbss = (inf->framelen - 3) / 32;
1301 WLAN_LOG_DEBUG(1, "Received %d hostscan results\n", nbss);
1306 if (hw->scanresults)
1307 kfree(hw->scanresults);
1309 hw->scanresults = kmalloc(sizeof(hfa384x_InfFrame_t), GFP_ATOMIC);
1310 memcpy(hw->scanresults, inf, sizeof(hfa384x_InfFrame_t));
1315 /* Notify/wake the sleeping caller. */
1316 hw->scanflag = nbss;
1317 wake_up_interruptible(&hw->cmdq);
1322 /*----------------------------------------------------------------
1323 * prism2sta_inf_chinforesults
1325 * Handles the receipt of a Channel Info Results info frame.
1328 * wlandev wlan device structure
1329 * inf ptr to info frame (contents in hfa384x order)
1338 ----------------------------------------------------------------*/
1339 static void prism2sta_inf_chinforesults(wlandevice_t *wlandev,
1340 hfa384x_InfFrame_t *inf)
1342 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1346 hw->channel_info.results.scanchannels =
1347 hfa384x2host_16(inf->info.chinforesult.scanchannels);
1349 memcpy(&inf->info.chinforesult, &hw->channel_info.results, sizeof(hfa384x_ChInfoResult_t));
1352 for (i=0, n=0; i<HFA384x_CHINFORESULT_MAX; i++) {
1353 if (hw->channel_info.results.scanchannels & (1<<i)) {
1354 int channel=hfa384x2host_16(inf->info.chinforesult.result[n].chid)-1;
1355 hfa384x_ChInfoResultSub_t *chinforesult=&hw->channel_info.results.result[channel];
1356 chinforesult->chid = channel;
1357 chinforesult->anl = hfa384x2host_16(inf->info.chinforesult.result[n].anl);
1358 chinforesult->pnl = hfa384x2host_16(inf->info.chinforesult.result[n].pnl);
1359 chinforesult->active = hfa384x2host_16(inf->info.chinforesult.result[n].active);
1360 WLAN_LOG_DEBUG(2, "chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n",
1362 chinforesult->active &
1363 HFA384x_CHINFORESULT_BSSACTIVE ? "signal" : "noise",
1364 chinforesult->anl, chinforesult->pnl,
1365 chinforesult->active & HFA384x_CHINFORESULT_PCFACTIVE ? 1 : 0
1370 atomic_set(&hw->channel_info.done, 2);
1372 hw->channel_info.count = n;
1377 void prism2sta_processing_defer(struct work_struct *data)
1379 hfa384x_t *hw = container_of(data, struct hfa384x, link_bh);
1380 wlandevice_t *wlandev = hw->wlandev;
1381 hfa384x_bytestr32_t ssid;
1385 /* First let's process the auth frames */
1387 struct sk_buff *skb;
1388 hfa384x_InfFrame_t *inf;
1390 while ( (skb = skb_dequeue(&hw->authq)) ) {
1391 inf = (hfa384x_InfFrame_t *) skb->data;
1392 prism2sta_inf_authreq_defer(wlandev, inf);
1397 /* Now let's handle the linkstatus stuff */
1398 if (hw->link_status == hw->link_status_new)
1401 hw->link_status = hw->link_status_new;
1403 switch(hw->link_status) {
1404 case HFA384x_LINK_NOTCONNECTED:
1405 /* I'm currently assuming that this is the initial link
1406 * state. It should only be possible immediately
1407 * following an Enable command.
1409 * Block Transmits, Ignore receives of data frames
1411 netif_carrier_off(wlandev->netdev);
1413 WLAN_LOG_INFO("linkstatus=NOTCONNECTED (unhandled)\n");
1416 case HFA384x_LINK_CONNECTED:
1417 /* This one indicates a successful scan/join/auth/assoc.
1418 * When we have the full MLME complement, this event will
1419 * signify successful completion of both mlme_authenticate
1420 * and mlme_associate. State management will get a little
1423 * Indicate authentication and/or association
1424 * Enable Transmits, Receives and pass up data frames
1427 netif_carrier_on(wlandev->netdev);
1429 /* If we are joining a specific AP, set our state and reset retries */
1430 if(hw->join_ap == 1)
1432 hw->join_retries = 60;
1434 /* Don't call this in monitor mode */
1435 if ( wlandev->netdev->type == ARPHRD_ETHER ) {
1438 WLAN_LOG_INFO("linkstatus=CONNECTED\n");
1440 /* For non-usb devices, we can use the sync versions */
1441 /* Collect the BSSID, and set state to allow tx */
1443 result = hfa384x_drvr_getconfig(hw,
1444 HFA384x_RID_CURRENTBSSID,
1445 wlandev->bssid, WLAN_BSSID_LEN);
1448 "getconfig(0x%02x) failed, result = %d\n",
1449 HFA384x_RID_CURRENTBSSID, result);
1453 result = hfa384x_drvr_getconfig(hw,
1454 HFA384x_RID_CURRENTSSID,
1455 &ssid, sizeof(ssid));
1458 "getconfig(0x%02x) failed, result = %d\n",
1459 HFA384x_RID_CURRENTSSID, result);
1462 prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid,
1463 (p80211pstrd_t *) &wlandev->ssid);
1465 /* Collect the port status */
1466 result = hfa384x_drvr_getconfig16(hw,
1467 HFA384x_RID_PORTSTATUS, &portstatus);
1470 "getconfig(0x%02x) failed, result = %d\n",
1471 HFA384x_RID_PORTSTATUS, result);
1475 (portstatus == HFA384x_PSTATUS_CONN_IBSS) ?
1476 WLAN_MACMODE_IBSS_STA : WLAN_MACMODE_ESS_STA;
1478 /* Get the ball rolling on the comms quality stuff */
1479 prism2sta_commsqual_defer(&hw->commsqual_bh);
1483 case HFA384x_LINK_DISCONNECTED:
1484 /* This one indicates that our association is gone. We've
1485 * lost connection with the AP and/or been disassociated.
1486 * This indicates that the MAC has completely cleared it's
1487 * associated state. We * should send a deauth indication
1488 * (implying disassoc) up * to the MLME.
1490 * Indicate Deauthentication
1491 * Block Transmits, Ignore receives of data frames
1493 if(hw->join_ap == 2)
1495 hfa384x_JoinRequest_data_t joinreq;
1496 joinreq = hw->joinreq;
1497 /* Send the join request */
1498 hfa384x_drvr_setconfig( hw,
1499 HFA384x_RID_JOINREQUEST,
1500 &joinreq, HFA384x_RID_JOINREQUEST_LEN);
1501 WLAN_LOG_INFO("linkstatus=DISCONNECTED (re-submitting join)\n");
1503 if (wlandev->netdev->type == ARPHRD_ETHER)
1504 WLAN_LOG_INFO("linkstatus=DISCONNECTED (unhandled)\n");
1506 wlandev->macmode = WLAN_MACMODE_NONE;
1508 netif_carrier_off(wlandev->netdev);
1512 case HFA384x_LINK_AP_CHANGE:
1513 /* This one indicates that the MAC has decided to and
1514 * successfully completed a change to another AP. We
1515 * should probably implement a reassociation indication
1516 * in response to this one. I'm thinking that the the
1517 * p80211 layer needs to be notified in case of
1518 * buffering/queueing issues. User mode also needs to be
1519 * notified so that any BSS dependent elements can be
1521 * associated state. We * should send a deauth indication
1522 * (implying disassoc) up * to the MLME.
1524 * Indicate Reassociation
1525 * Enable Transmits, Receives and pass up data frames
1527 WLAN_LOG_INFO("linkstatus=AP_CHANGE\n");
1529 result = hfa384x_drvr_getconfig(hw,
1530 HFA384x_RID_CURRENTBSSID,
1531 wlandev->bssid, WLAN_BSSID_LEN);
1534 "getconfig(0x%02x) failed, result = %d\n",
1535 HFA384x_RID_CURRENTBSSID, result);
1539 result = hfa384x_drvr_getconfig(hw,
1540 HFA384x_RID_CURRENTSSID,
1541 &ssid, sizeof(ssid));
1544 "getconfig(0x%02x) failed, result = %d\n",
1545 HFA384x_RID_CURRENTSSID, result);
1548 prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid,
1549 (p80211pstrd_t *) &wlandev->ssid);
1552 hw->link_status = HFA384x_LINK_CONNECTED;
1553 netif_carrier_on(wlandev->netdev);
1557 case HFA384x_LINK_AP_OUTOFRANGE:
1558 /* This one indicates that the MAC has decided that the
1559 * AP is out of range, but hasn't found a better candidate
1560 * so the MAC maintains its "associated" state in case
1561 * we get back in range. We should block transmits and
1562 * receives in this state. Do we need an indication here?
1563 * Probably not since a polling user-mode element would
1564 * get this status from from p2PortStatus(FD40). What about
1567 * Block Transmits, Ignore receives of data frames
1569 WLAN_LOG_INFO("linkstatus=AP_OUTOFRANGE (unhandled)\n");
1571 netif_carrier_off(wlandev->netdev);
1575 case HFA384x_LINK_AP_INRANGE:
1576 /* This one indicates that the MAC has decided that the
1577 * AP is back in range. We continue working with our
1578 * existing association.
1580 * Enable Transmits, Receives and pass up data frames
1582 WLAN_LOG_INFO("linkstatus=AP_INRANGE\n");
1584 hw->link_status = HFA384x_LINK_CONNECTED;
1585 netif_carrier_on(wlandev->netdev);
1589 case HFA384x_LINK_ASSOCFAIL:
1590 /* This one is actually a peer to CONNECTED. We've
1591 * requested a join for a given SSID and optionally BSSID.
1592 * We can use this one to indicate authentication and
1593 * association failures. The trick is going to be
1594 * 1) identifying the failure, and 2) state management.
1596 * Disable Transmits, Ignore receives of data frames
1598 if(hw->join_ap && --hw->join_retries > 0)
1600 hfa384x_JoinRequest_data_t joinreq;
1601 joinreq = hw->joinreq;
1602 /* Send the join request */
1603 hfa384x_drvr_setconfig( hw,
1604 HFA384x_RID_JOINREQUEST,
1605 &joinreq, HFA384x_RID_JOINREQUEST_LEN);
1606 WLAN_LOG_INFO("linkstatus=ASSOCFAIL (re-submitting join)\n");
1608 WLAN_LOG_INFO("linkstatus=ASSOCFAIL (unhandled)\n");
1611 netif_carrier_off(wlandev->netdev);
1616 /* This is bad, IO port problems? */
1618 "unknown linkstatus=0x%02x\n", hw->link_status);
1623 wlandev->linkstatus = (hw->link_status == HFA384x_LINK_CONNECTED);
1625 p80211wext_event_associated(wlandev, wlandev->linkstatus);
1632 /*----------------------------------------------------------------
1633 * prism2sta_inf_linkstatus
1635 * Handles the receipt of a Link Status info frame.
1638 * wlandev wlan device structure
1639 * inf ptr to info frame (contents in hfa384x order)
1648 ----------------------------------------------------------------*/
1649 static void prism2sta_inf_linkstatus(wlandevice_t *wlandev,
1650 hfa384x_InfFrame_t *inf)
1652 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1656 hw->link_status_new = hfa384x2host_16(inf->info.linkstatus.linkstatus);
1658 schedule_work(&hw->link_bh);
1664 /*----------------------------------------------------------------
1665 * prism2sta_inf_assocstatus
1667 * Handles the receipt of an Association Status info frame. Should
1668 * be present in APs only.
1671 * wlandev wlan device structure
1672 * inf ptr to info frame (contents in hfa384x order)
1681 ----------------------------------------------------------------*/
1682 static void prism2sta_inf_assocstatus(wlandevice_t *wlandev,
1683 hfa384x_InfFrame_t *inf)
1685 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1686 hfa384x_AssocStatus_t rec;
1691 memcpy(&rec, &inf->info.assocstatus, sizeof(rec));
1692 rec.assocstatus = hfa384x2host_16(rec.assocstatus);
1693 rec.reason = hfa384x2host_16(rec.reason);
1696 ** Find the address in the list of authenticated stations. If it wasn't
1697 ** found, then this address has not been previously authenticated and
1698 ** something weird has happened if this is anything other than an
1699 ** "authentication failed" message. If the address was found, then
1700 ** set the "associated" flag for that station, based on whether the
1701 ** station is associating or losing its association. Something weird
1702 ** has also happened if we find the address in the list of authenticated
1703 ** stations but we are getting an "authentication failed" message.
1706 for (i = 0; i < hw->authlist.cnt; i++)
1707 if (memcmp(rec.sta_addr, hw->authlist.addr[i], WLAN_ADDR_LEN) == 0)
1710 if (i >= hw->authlist.cnt) {
1711 if (rec.assocstatus != HFA384x_ASSOCSTATUS_AUTHFAIL)
1712 WLAN_LOG_WARNING("assocstatus info frame received for non-authenticated station.\n");
1714 hw->authlist.assoc[i] =
1715 (rec.assocstatus == HFA384x_ASSOCSTATUS_STAASSOC ||
1716 rec.assocstatus == HFA384x_ASSOCSTATUS_REASSOC);
1718 if (rec.assocstatus == HFA384x_ASSOCSTATUS_AUTHFAIL)
1719 WLAN_LOG_WARNING("authfail assocstatus info frame received for authenticated station.\n");
1727 /*----------------------------------------------------------------
1728 * prism2sta_inf_authreq
1730 * Handles the receipt of an Authentication Request info frame. Should
1731 * be present in APs only.
1734 * wlandev wlan device structure
1735 * inf ptr to info frame (contents in hfa384x order)
1745 ----------------------------------------------------------------*/
1746 static void prism2sta_inf_authreq(wlandevice_t *wlandev,
1747 hfa384x_InfFrame_t *inf)
1749 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1750 struct sk_buff *skb;
1754 skb = dev_alloc_skb(sizeof(*inf));
1756 skb_put(skb, sizeof(*inf));
1757 memcpy(skb->data, inf, sizeof(*inf));
1758 skb_queue_tail(&hw->authq, skb);
1759 schedule_work(&hw->link_bh);
1765 static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
1766 hfa384x_InfFrame_t *inf)
1768 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1769 hfa384x_authenticateStation_data_t rec;
1771 int i, added, result, cnt;
1777 ** Build the AuthenticateStation record. Initialize it for denying
1781 memcpy(rec.address, inf->info.authreq.sta_addr, WLAN_ADDR_LEN);
1782 rec.status = P80211ENUM_status_unspec_failure;
1785 ** Authenticate based on the access mode.
1788 switch (hw->accessmode) {
1789 case WLAN_ACCESS_NONE:
1792 ** Deny all new authentications. However, if a station
1793 ** is ALREADY authenticated, then accept it.
1796 for (i = 0; i < hw->authlist.cnt; i++)
1797 if (memcmp(rec.address, hw->authlist.addr[i],
1798 WLAN_ADDR_LEN) == 0) {
1799 rec.status = P80211ENUM_status_successful;
1805 case WLAN_ACCESS_ALL:
1808 ** Allow all authentications.
1811 rec.status = P80211ENUM_status_successful;
1814 case WLAN_ACCESS_ALLOW:
1817 ** Only allow the authentication if the MAC address
1818 ** is in the list of allowed addresses.
1820 ** Since this is the interrupt handler, we may be here
1821 ** while the access list is in the middle of being
1822 ** updated. Choose the list which is currently okay.
1823 ** See "prism2mib_priv_accessallow()" for details.
1826 if (hw->allow.modify == 0) {
1827 cnt = hw->allow.cnt;
1828 addr = hw->allow.addr[0];
1830 cnt = hw->allow.cnt1;
1831 addr = hw->allow.addr1[0];
1834 for (i = 0; i < cnt; i++, addr += WLAN_ADDR_LEN)
1835 if (memcmp(rec.address, addr, WLAN_ADDR_LEN) == 0) {
1836 rec.status = P80211ENUM_status_successful;
1842 case WLAN_ACCESS_DENY:
1845 ** Allow the authentication UNLESS the MAC address is
1846 ** in the list of denied addresses.
1848 ** Since this is the interrupt handler, we may be here
1849 ** while the access list is in the middle of being
1850 ** updated. Choose the list which is currently okay.
1851 ** See "prism2mib_priv_accessdeny()" for details.
1854 if (hw->deny.modify == 0) {
1856 addr = hw->deny.addr[0];
1858 cnt = hw->deny.cnt1;
1859 addr = hw->deny.addr1[0];
1862 rec.status = P80211ENUM_status_successful;
1864 for (i = 0; i < cnt; i++, addr += WLAN_ADDR_LEN)
1865 if (memcmp(rec.address, addr, WLAN_ADDR_LEN) == 0) {
1866 rec.status = P80211ENUM_status_unspec_failure;
1874 ** If the authentication is okay, then add the MAC address to the list
1875 ** of authenticated stations. Don't add the address if it is already in
1876 ** the list. (802.11b does not seem to disallow a station from issuing
1877 ** an authentication request when the station is already authenticated.
1878 ** Does this sort of thing ever happen? We might as well do the check
1884 if (rec.status == P80211ENUM_status_successful) {
1885 for (i = 0; i < hw->authlist.cnt; i++)
1886 if (memcmp(rec.address, hw->authlist.addr[i], WLAN_ADDR_LEN) == 0)
1889 if (i >= hw->authlist.cnt) {
1890 if (hw->authlist.cnt >= WLAN_AUTH_MAX) {
1891 rec.status = P80211ENUM_status_ap_full;
1893 memcpy(hw->authlist.addr[hw->authlist.cnt],
1894 rec.address, WLAN_ADDR_LEN);
1902 ** Send back the results of the authentication. If this doesn't work,
1903 ** then make sure to remove the address from the authenticated list if
1907 rec.status = host2hfa384x_16(rec.status);
1908 rec.algorithm = inf->info.authreq.algorithm;
1910 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_AUTHENTICATESTA,
1913 if (added) hw->authlist.cnt--;
1914 WLAN_LOG_ERROR("setconfig(authenticatestation) failed, result=%d\n", result);
1923 /*----------------------------------------------------------------
1924 * prism2sta_inf_psusercnt
1926 * Handles the receipt of a PowerSaveUserCount info frame. Should
1927 * be present in APs only.
1930 * wlandev wlan device structure
1931 * inf ptr to info frame (contents in hfa384x order)
1940 ----------------------------------------------------------------*/
1941 static void prism2sta_inf_psusercnt(wlandevice_t *wlandev,
1942 hfa384x_InfFrame_t *inf)
1944 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1948 hw->psusercount = hfa384x2host_16(inf->info.psusercnt.usercnt);
1955 /*----------------------------------------------------------------
1958 * Handles the DTIM early warning event.
1961 * wlandev wlan device structure
1970 ----------------------------------------------------------------*/
1971 void prism2sta_ev_dtim(wlandevice_t *wlandev)
1974 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
1977 WLAN_LOG_DEBUG(3, "DTIM event, currently unhandled.\n");
1983 /*----------------------------------------------------------------
1984 * prism2sta_ev_infdrop
1986 * Handles the InfDrop event.
1989 * wlandev wlan device structure
1998 ----------------------------------------------------------------*/
1999 void prism2sta_ev_infdrop(wlandevice_t *wlandev)
2002 hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
2005 WLAN_LOG_DEBUG(3, "Info frame dropped due to card mem low.\n");
2011 /*----------------------------------------------------------------
2014 * Handles the Info event.
2017 * wlandev wlan device structure
2018 * inf ptr to a generic info frame
2027 ----------------------------------------------------------------*/
2028 void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
2031 inf->infotype = hfa384x2host_16(inf->infotype);
2033 switch ( inf->infotype ) {
2034 case HFA384x_IT_HANDOVERADDR:
2035 prism2sta_inf_handover(wlandev, inf);
2037 case HFA384x_IT_COMMTALLIES:
2038 prism2sta_inf_tallies(wlandev, inf);
2040 case HFA384x_IT_HOSTSCANRESULTS:
2041 prism2sta_inf_hostscanresults(wlandev, inf);
2043 case HFA384x_IT_SCANRESULTS:
2044 prism2sta_inf_scanresults(wlandev, inf);
2046 case HFA384x_IT_CHINFORESULTS:
2047 prism2sta_inf_chinforesults(wlandev, inf);
2049 case HFA384x_IT_LINKSTATUS:
2050 prism2sta_inf_linkstatus(wlandev, inf);
2052 case HFA384x_IT_ASSOCSTATUS:
2053 prism2sta_inf_assocstatus(wlandev, inf);
2055 case HFA384x_IT_AUTHREQ:
2056 prism2sta_inf_authreq(wlandev, inf);
2058 case HFA384x_IT_PSUSERCNT:
2059 prism2sta_inf_psusercnt(wlandev, inf);
2061 case HFA384x_IT_KEYIDCHANGED:
2062 WLAN_LOG_WARNING("Unhandled IT_KEYIDCHANGED\n");
2064 case HFA384x_IT_ASSOCREQ:
2065 WLAN_LOG_WARNING("Unhandled IT_ASSOCREQ\n");
2067 case HFA384x_IT_MICFAILURE:
2068 WLAN_LOG_WARNING("Unhandled IT_MICFAILURE\n");
2072 "Unknown info type=0x%02x\n", inf->infotype);
2080 /*----------------------------------------------------------------
2081 * prism2sta_ev_txexc
2083 * Handles the TxExc event. A Transmit Exception event indicates
2084 * that the MAC's TX process was unsuccessful - so the packet did
2085 * not get transmitted.
2088 * wlandev wlan device structure
2089 * status tx frame status word
2098 ----------------------------------------------------------------*/
2099 void prism2sta_ev_txexc(wlandevice_t *wlandev, UINT16 status)
2103 WLAN_LOG_DEBUG(3, "TxExc status=0x%x.\n", status);
2110 /*----------------------------------------------------------------
2113 * Handles the Tx event.
2116 * wlandev wlan device structure
2117 * status tx frame status word
2125 ----------------------------------------------------------------*/
2126 void prism2sta_ev_tx(wlandevice_t *wlandev, UINT16 status)
2129 WLAN_LOG_DEBUG(4, "Tx Complete, status=0x%04x\n", status);
2130 /* update linux network stats */
2131 wlandev->linux_stats.tx_packets++;
2137 /*----------------------------------------------------------------
2140 * Handles the Rx event.
2143 * wlandev wlan device structure
2152 ----------------------------------------------------------------*/
2153 void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb)
2157 p80211netdev_rx(wlandev, skb);
2163 /*----------------------------------------------------------------
2164 * prism2sta_ev_alloc
2166 * Handles the Alloc event.
2169 * wlandev wlan device structure
2178 ----------------------------------------------------------------*/
2179 void prism2sta_ev_alloc(wlandevice_t *wlandev)
2183 p80211netdev_wake_queue(wlandev);
2189 /*----------------------------------------------------------------
2192 * Called at module init time. This creates the wlandevice_t structure
2193 * and initializes it with relevant bits.
2199 * the created wlandevice_t structure.
2202 * also allocates the priv/hw structures.
2207 ----------------------------------------------------------------*/
2208 static wlandevice_t *create_wlan(void)
2210 wlandevice_t *wlandev = NULL;
2211 hfa384x_t *hw = NULL;
2213 /* Alloc our structures */
2214 wlandev = kmalloc(sizeof(wlandevice_t), GFP_KERNEL);
2215 hw = kmalloc(sizeof(hfa384x_t), GFP_KERNEL);
2217 if (!wlandev || !hw) {
2218 WLAN_LOG_ERROR("%s: Memory allocation failure.\n", dev_info);
2219 if (wlandev) kfree(wlandev);
2224 /* Clear all the structs */
2225 memset(wlandev, 0, sizeof(wlandevice_t));
2226 memset(hw, 0, sizeof(hfa384x_t));
2228 /* Initialize the network device object. */
2229 wlandev->nsdname = dev_info;
2230 wlandev->msdstate = WLAN_MSD_HWPRESENT_PENDING;
2232 wlandev->open = prism2sta_open;
2233 wlandev->close = prism2sta_close;
2234 wlandev->reset = prism2sta_reset;
2235 #ifdef CONFIG_PROC_FS
2236 wlandev->nsd_proc_read = prism2sta_proc_read;
2238 wlandev->txframe = prism2sta_txframe;
2239 wlandev->mlmerequest = prism2sta_mlmerequest;
2240 wlandev->set_multicast_list = prism2sta_setmulticast;
2241 wlandev->tx_timeout = hfa384x_tx_timeout;
2243 wlandev->nsdcaps = P80211_NSDCAP_HWFRAGMENT |
2244 P80211_NSDCAP_AUTOJOIN;
2246 /* Initialize the device private data stucture. */
2247 hw->dot11_desired_bss_type = 1;
2252 #ifdef CONFIG_PROC_FS
2254 prism2sta_proc_read(
2263 wlandevice_t *wlandev = (wlandevice_t *) data;
2264 hfa384x_t *hw = (hfa384x_t *) wlandev->priv;
2274 // XXX 0x0001 for prism2.5/3, 0x0000 for prism2.
2277 p += sprintf(p, "# %s version %s (%s)\n\n",
2279 WLAN_RELEASE, WLAN_BUILD_DATE);
2281 p += sprintf(p, "# nic h/w: id=0x%02x %d.%d.%d\n",
2282 hw->ident_nic.id, hw->ident_nic.major,
2283 hw->ident_nic.minor, hw->ident_nic.variant);
2285 p += sprintf(p, "# pri f/w: id=0x%02x %d.%d.%d\n",
2286 hw->ident_pri_fw.id, hw->ident_pri_fw.major,
2287 hw->ident_pri_fw.minor, hw->ident_pri_fw.variant);
2289 if (hw->ident_sta_fw.id == 0x1f) {
2290 p += sprintf(p, "# sta f/w: id=0x%02x %d.%d.%d\n",
2291 hw->ident_sta_fw.id, hw->ident_sta_fw.major,
2292 hw->ident_sta_fw.minor, hw->ident_sta_fw.variant);
2294 p += sprintf(p, "# ap f/w: id=0x%02x %d.%d.%d\n",
2295 hw->ident_sta_fw.id, hw->ident_sta_fw.major,
2296 hw->ident_sta_fw.minor, hw->ident_sta_fw.variant);
2305 void prism2sta_commsqual_defer(struct work_struct *data)
2307 hfa384x_t *hw = container_of(data, struct hfa384x, commsqual_bh);
2308 wlandevice_t *wlandev = hw->wlandev;
2309 hfa384x_bytestr32_t ssid;
2314 if (hw->wlandev->hwremoved)
2317 /* we don't care if we're in AP mode */
2318 if ((wlandev->macmode == WLAN_MACMODE_NONE) ||
2319 (wlandev->macmode == WLAN_MACMODE_ESS_AP)) {
2323 /* It only makes sense to poll these in non-IBSS */
2324 if (wlandev->macmode != WLAN_MACMODE_IBSS_STA) {
2325 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DBMCOMMSQUALITY,
2327 HFA384x_RID_DBMCOMMSQUALITY_LEN);
2330 WLAN_LOG_ERROR("error fetching commsqual\n");
2334 // qual.CQ_currBSS; // link
2335 // ASL_currBSS; // level
2336 // qual.ANL_currFC; // noise
2338 WLAN_LOG_DEBUG(3, "commsqual %d %d %d\n",
2339 hfa384x2host_16(hw->qual.CQ_currBSS),
2340 hfa384x2host_16(hw->qual.ASL_currBSS),
2341 hfa384x2host_16(hw->qual.ANL_currFC));
2344 /* Lastly, we need to make sure the BSSID didn't change on us */
2345 result = hfa384x_drvr_getconfig(hw,
2346 HFA384x_RID_CURRENTBSSID,
2347 wlandev->bssid, WLAN_BSSID_LEN);
2350 "getconfig(0x%02x) failed, result = %d\n",
2351 HFA384x_RID_CURRENTBSSID, result);
2355 result = hfa384x_drvr_getconfig(hw,
2356 HFA384x_RID_CURRENTSSID,
2357 &ssid, sizeof(ssid));
2360 "getconfig(0x%02x) failed, result = %d\n",
2361 HFA384x_RID_CURRENTSSID, result);
2364 prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *)&ssid,
2365 (p80211pstrd_t *) &wlandev->ssid);
2368 /* Reschedule timer */
2369 mod_timer(&hw->commsqual_timer, jiffies + HZ);
2375 void prism2sta_commsqual_timer(unsigned long data)
2377 hfa384x_t *hw = (hfa384x_t *) data;
2381 schedule_work(&hw->commsqual_bh);