49 #define MAX_JOIN_INFO_COUNT 2 56 #define WLAN_HOSTIF WLAN_PLX 64 #define __LINUX_WLAN__ 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 ) );
#define host2hfa384x_16(n)
#define HFA384x_RID_CNFAUTHENTICATION
static uint16_t hfa384x_getreg_noswap(hfa384x_t *hw, unsigned int reg)
#define EINVAL
Invalid argument.
#define HFA384x_TX_STRUCTYPE_SET(v)
static int hfa384x_prepare_bap(hfa384x_t *hw, uint16_t id, uint16_t offset)
static int hfa384x_copy_to_bap(hfa384x_t *hw, uint16_t id, uint16_t offset, void *buf, unsigned int len)
int printf(const char *fmt,...)
Write a formatted string to the console.
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
#define HFA384x_TXSTATUS_ISDISCON(v)
#define HFA384x_TX_TXOK_SET(v)
#define HFA384x_TXSTATUS_ISFORMERR(v)
static unsigned int unsigned int reg
#define HFA384x_CNFAUTHENTICATION_OPENSYSTEM
#define HFA384x_BAP_OFFSET_MAX
#define WLAN_SET_FC_FSTYPE(n)
#define HFA384x_RID_CURRENTBSSID
#define HFA384x_EVSTAT_TXEXC
#define HFA384x_EVSTAT_ISRX(value)
#define HFA384x_OFFSET_ISBUSY(value)
#define outw(data, io_addr)
#define HFA384x_EVSTAT_TX
uint16_t readw(volatile uint16_t *io_addr)
Read 16-bit word from memory-mapped device.
char ssid[0]
SSID data, not NUL-terminated.
FILE_LICENCE(GPL2_OR_LATER)
static int hfa384x_drvr_setconfig16(hfa384x_t *hw, uint16_t rid, uint16_t *val)
#define HFA384x_CMD_WRITE_SET(value)
#define HFA384x_CMDCODE_TX
#define WLAN_FSTYPE_DATAONLY
#define HFA384x_CMD_ISBUSY(value)
#define HFA384x_EVACK_INFO
#define HFA384x_RID_CNFOWNMACADDR_LEN
#define HFA384x_EVACK_CMD
int dummy_connect(struct nic *nic __unused)
#define HFA384x_TX_TXEX_SET(v)
#define HFA384x_EVACK_RX_SET(value)
#define HFA384x_TXSTATUS_ISAGEDERR(v)
#define HFA384x_LINK_CONNECTED
#define MAX_JOIN_INFO_COUNT
#define HFA384x_RID_TXRATECNTL
#define HFA384x_RID_CNFDESIREDSSID_LEN
uint8_t oui[WLAN_IEEE_OUI_LEN]
static struct nic_operations prism2_operations
#define HFA384x_RID_CNFMAXDATALEN
volatile unsigned long status
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define HFA384x_CMDCODE_ENABLE
#define HFA384x_STATUS_RESULT_GET(value)
#define WLAN_IEEE_OUI_LEN
#define HFA384x_RX_DATA_OFF
struct wlan_snap wlan_snap_t
pseudo_bit_t value[0x00020]
static hfa384x_t hw_global
#define __unused
Declare a variable or data structure as unused.
#define HFA384x_CMDCODE_INIT
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
uint8_t bssid[WLAN_BSSID_LEN]
uint16_t count
Number of entries.
#define HFA384x_EVSTAT_ISCMD(value)
#define HFA384x_TXCOMPLFID
static const char hardcoded_ssid[]
#define HFA384x_TX_MACPORT_SET(v)
#define HFA384x_TXSTATUS_ISRETRYERR(v)
static void prism2_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
#define HFA384x_EVSTAT_INFO
static void prism2_disable(struct nic *nic __unused)
#define hfa384x2host_32(n)
#define HFA384x_RID_CNFPORTTYPE
static void hfa384x_setreg(hfa384x_t *hw, uint16_t val, unsigned int reg)
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
static void hfa384x_setreg_noswap(hfa384x_t *hw, uint16_t val, unsigned int reg)
#define WLAN_SET_FC_FTYPE(n)
static int hfa384x_drvr_setconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len)
#define host2hfa384x_32(n)
#define HFA384x_TXSTATUS_ISACKERR(v)
static int hfa384x_docmd_wait(hfa384x_t *hw, uint16_t cmd, uint16_t parm0, uint16_t parm1, uint16_t parm2)
#define HFA384x_RID_CNFDESIREDSSID
hfa384x_LinkStatus_t linkstatus
#define WLAN_SET_FC_TODS(n)
static int prism2_probe(struct nic *nic, hfa384x_t *hw)
static const wlan_llc_t wlan_llc_snap
#define HFA384x_RID_CNFOWNMACADDR
struct wlan_80211hdr wlan_80211hdr_t
unsigned char * node_addr
static void prism2_irq(struct nic *nic __unused, irq_action_t action __unused)
#define HFA384x_OFFSET_ISERR(value)
static uint16_t hfa384x_getreg(hfa384x_t *hw, unsigned int reg)
static int prism2_poll(struct nic *nic, int retrieve)
#define HFA384x_EVSTAT_ISTXEXC(value)
static int hfa384x_wait_for_event(hfa384x_t *hw, uint16_t event_mask, uint16_t event_ack, int wait, int timeout, const char *descr)
#define HFA384x_CMDCODE_ALLOC
#define hfa384x2host_16(n)
#define HFA384x_CMD_MACPORT_SET(value)
uint16_t offset
Offset to command line.
#define HFA384x_DRVR_TXBUF_MAX
struct wlan_llc wlan_llc_t
#define HFA384x_IT_LINKSTATUS
#define DBG(...)
Print a debugging message.
struct nic_operations * nic_op
static int hfa384x_cmd_access(hfa384x_t *hw, uint16_t write, uint16_t rid)
static int hfa384x_drvr_getconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len)
int(* connect)(struct nic *)
static int hfa384x_copy_from_bap(hfa384x_t *hw, uint16_t id, uint16_t offset, void *buf, unsigned int len)
#define ETIMEDOUT
Connection timed out.
#define HFA384x_EVSTAT_ALLOC
#define HFA384x_CMD_CMDCODE_SET(value)
void * memset(void *dest, int character, size_t len) __nonnull
#define HFA384x_CMDCODE_ACCESS