49#define MAX_JOIN_INFO_COUNT 2
56#define WLAN_HOSTIF WLAN_PLX
70#define BAP_TIMEOUT ( 5000 )
77#define __le16_to_cpu(x) (x)
78#define __le32_to_cpu(x) (x)
79#define __cpu_to_le16(x) (x)
80#define __cpu_to_le32(x) (x)
82#define hfa384x2host_16(n) (__le16_to_cpu((uint16_t)(n)))
83#define hfa384x2host_32(n) (__le32_to_cpu((uint32_t)(n)))
84#define host2hfa384x_16(n) (__cpu_to_le16((uint16_t)(n)))
85#define host2hfa384x_32(n) (__cpu_to_le32((uint32_t)(n)))
92#define PLX_LOCAL_CONFIG_REGISTER_BASE ( PCI_BASE_ADDRESS_1 )
93#define PLX_LOCAL_ADDRESS_SPACE_0_BASE ( PCI_BASE_ADDRESS_2 )
94#define PLX_LOCAL_ADDRESS_SPACE_1_BASE ( PCI_BASE_ADDRESS_3 )
95#define PLX_LOCAL_ADDRESS_SPACE_2_BASE ( PCI_BASE_ADDRESS_4 )
96#define PLX_LOCAL_ADDRESS_SPACE_3_BASE ( PCI_BASE_ADDRESS_5 )
98#define PRISM2_PLX_ATTR_MEM_BASE ( PLX_LOCAL_ADDRESS_SPACE_0_BASE )
99#define PRISM2_PLX_IO_BASE ( PLX_LOCAL_ADDRESS_SPACE_1_BASE )
101#define PRISM2_PCI_MEM_BASE ( PCI_BASE_ADDRESS_0 )
108#define CISTPL_VERS_1 ( 0x15 )
109#define CISTPL_END ( 0xff )
111#define CIS_STEP ( 2 )
112#define CISTPL_HEADER_LEN ( 2 * CIS_STEP )
113#define CISTPL_LEN_OFF ( 1 * CIS_STEP )
114#define CISTPL_VERS_1_STR_OFF ( 4 * CIS_STEP )
121#define COR_OFFSET ( 0x3e0 )
122#define COR_VALUE ( 0x41 )
159#define WLAN_IEEE_OUI_LEN 3
185#if (WLAN_HOSTIF == WLAN_PLX)
187#elif (WLAN_HOSTIF == WLAN_PCI)
195#if (WLAN_HOSTIF == WLAN_PLX)
197#elif (WLAN_HOSTIF == WLAN_PCI)
252 printf(
"hfa384x_cmd timeout(1), reg=0x%0hx.\n",
reg);
276 printf(
"hfa384x_cmd timeout(2), reg=0x%0hx.\n",
reg);
345 void *buf,
unsigned int len)
356 for ( i = 0; i < (
len & 0xfffe); i+=2 ) {
384 void *buf,
unsigned int len)
395 for ( i = 0; i < (
len & 0xfffe); i+=2 ) {
453 printf(
"Call to hfa384x_cmd_access failed\n");
528 printf(
"Failure writing record header\n");
535 printf(
"Failure writing record data\n");
598 printf(
"hfa384x: Timed out waiting for %s\n", descr);
624 if ( ! retrieve )
return 1;
678 printf(
"hfa384x: Tx FID allocate command failed: Aborting transmit..\n");
710 printf(
"hfa384x: Transmit failed with result %#hx.\n",
result);
716 200, 500,
"Tx to complete\n" );
720 printf (
"Tx exception occurred with fid %#hx\n", fid );
723 printf(
"hfa384x: Tx error occurred (status %#hx):\n",
status);
820 printf (
"Too many failed attempts - aborting\n" );
827 printf (
"Attempting to autojoin to any available access point (attempt %d)...", info_count );
829 printf (
"Attempting to autojoin to SSID %s (attempt %d)...", &
ssid[2], info_count );
845 printf (
"Unexpected info frame type %#hx (not LinkStatus type)\n", inf.
infotype );
858 DBG (
"Link connected (BSSID %s - ",
eth_ntoa (
hw->bssid ) );
pseudo_bit_t value[0x00020]
uint16_t offset
Offset to command line.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define __unused
Declare a variable or data structure as unused.
#define DBG(...)
Print a debugging message.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EINVAL
Invalid argument.
#define ETIMEDOUT
Connection timed out.
#define HFA384x_CMD_WRITE_SET(value)
#define HFA384x_RID_CNFPORTTYPE
#define HFA384x_RID_CNFOWNMACADDR
#define HFA384x_STATUS_RESULT_GET(value)
#define HFA384x_RID_CNFOWNMACADDR_LEN
#define HFA384x_CMDCODE_TX
#define HFA384x_EVSTAT_TXEXC
#define HFA384x_RID_CNFDESIREDSSID
#define HFA384x_RID_CNFDESIREDSSID_LEN
#define HFA384x_IT_LINKSTATUS
#define HFA384x_CMD_ISBUSY(value)
#define HFA384x_CMD_CMDCODE_SET(value)
#define HFA384x_RID_CURRENTBSSID
#define HFA384x_RID_CNFMAXDATALEN
#define HFA384x_EVACK_INFO
#define HFA384x_RX_DATA_OFF
#define HFA384x_EVSTAT_TX
#define HFA384x_CMD_MACPORT_SET(value)
#define HFA384x_EVACK_CMD
#define HFA384x_EVSTAT_ALLOC
#define HFA384x_EVSTAT_INFO
#define HFA384x_TXSTATUS_ISDISCON(v)
struct hfa384x_tx_frame hfa384x_tx_frame_t
#define HFA384x_DRVR_TXBUF_MAX
#define HFA384x_RID_TXRATECNTL
#define HFA384x_TXSTATUS_ISRETRYERR(v)
#define HFA384x_TX_STRUCTYPE_SET(v)
#define HFA384x_CMDCODE_INIT
#define HFA384x_TXSTATUS_ISFORMERR(v)
#define HFA384x_CNFAUTHENTICATION_OPENSYSTEM
#define HFA384x_TXSTATUS_ISAGEDERR(v)
#define HFA384x_CMDCODE_ACCESS
#define HFA384x_EVSTAT_ISTXEXC(value)
#define HFA384x_TXCOMPLFID
#define HFA384x_TX_TXEX_SET(v)
#define HFA384x_EVSTAT_ISCMD(value)
#define HFA384x_EVACK_RX_SET(value)
#define HFA384x_TX_MACPORT_SET(v)
#define HFA384x_OFFSET_ISERR(value)
#define HFA384x_TXSTATUS_ISACKERR(v)
#define HFA384x_BAP_OFFSET_MAX
struct hfa384x_record hfa384x_rec_t
#define HFA384x_TX_TXOK_SET(v)
#define HFA384x_LINK_CONNECTED
struct hfa384x_InfFrame hfa384x_InfFrame_t
#define HFA384x_OFFSET_ISBUSY(value)
#define HFA384x_CMDCODE_ALLOC
struct hfa384x_rx_frame hfa384x_rx_frame_t
#define HFA384x_EVSTAT_ISRX(value)
#define HFA384x_RID_CNFAUTHENTICATION
#define HFA384x_CMDCODE_ENABLE
char ssid[0]
SSID data, not NUL-terminated.
#define outw(data, io_addr)
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
int dummy_connect(struct nic *nic __unused)
static unsigned int unsigned int reg
#define WLAN_SET_FC_TODS(n)
#define WLAN_FSTYPE_DATAONLY
#define WLAN_SET_FC_FTYPE(n)
#define WLAN_SET_FC_FSTYPE(n)
static int hfa384x_cmd_access(hfa384x_t *hw, uint16_t write, uint16_t rid)
#define host2hfa384x_32(n)
#define host2hfa384x_16(n)
static int hfa384x_wait_for_event(hfa384x_t *hw, uint16_t event_mask, uint16_t event_ack, int wait, int timeout, const char *descr)
struct wlan_80211hdr wlan_80211hdr_t
#define WLAN_IEEE_OUI_LEN
struct wlan_snap wlan_snap_t
static int prism2_probe(struct nic *nic, hfa384x_t *hw)
static const wlan_llc_t wlan_llc_snap
static hfa384x_t hw_global
static int hfa384x_copy_to_bap(hfa384x_t *hw, uint16_t id, uint16_t offset, void *buf, unsigned int len)
static uint16_t hfa384x_getreg(hfa384x_t *hw, unsigned int reg)
#define hfa384x2host_16(n)
static void prism2_disable(struct nic *nic __unused)
static int hfa384x_drvr_setconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len)
static void prism2_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
static void hfa384x_setreg_noswap(hfa384x_t *hw, uint16_t val, unsigned int reg)
static uint16_t hfa384x_getreg_noswap(hfa384x_t *hw, unsigned int reg)
static const char hardcoded_ssid[]
static void prism2_irq(struct nic *nic __unused, irq_action_t action __unused)
static int prism2_poll(struct nic *nic, int retrieve)
static int hfa384x_drvr_setconfig16(hfa384x_t *hw, uint16_t rid, uint16_t *val)
struct wlan_llc wlan_llc_t
static int hfa384x_docmd_wait(hfa384x_t *hw, uint16_t cmd, uint16_t parm0, uint16_t parm1, uint16_t parm2)
#define MAX_JOIN_INFO_COUNT
static int hfa384x_prepare_bap(hfa384x_t *hw, uint16_t id, uint16_t offset)
static int hfa384x_drvr_getconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len)
#define hfa384x2host_32(n)
static struct nic_operations prism2_operations
static void hfa384x_setreg(hfa384x_t *hw, uint16_t val, unsigned int reg)
static int hfa384x_copy_from_bap(hfa384x_t *hw, uint16_t id, uint16_t offset, void *buf, unsigned int len)
uint8_t bssid[WLAN_BSSID_LEN]
unsigned char * node_addr
struct nic_operations * nic_op
volatile unsigned long status
uint8_t oui[WLAN_IEEE_OUI_LEN]
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
hfa384x_LinkStatus_t linkstatus
int printf(const char *fmt,...)
Write a formatted string to the console.