Commit 4379cad1 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
parents 46374d3f 5c7895c0
...@@ -29,13 +29,13 @@ ...@@ -29,13 +29,13 @@
/* descriptor block used for chained dma transfers */ /* descriptor block used for chained dma transfers */
struct plx_dma_desc { struct plx_dma_desc {
volatile uint32_t pci_start_addr; __le32 pci_start_addr;
volatile uint32_t local_start_addr; __le32 local_start_addr;
/* transfer_size is in bytes, only first 23 bits of register are used */ /* transfer_size is in bytes, only first 23 bits of register are used */
volatile uint32_t transfer_size; __le32 transfer_size;
/* address of next descriptor (quad word aligned), plus some /* address of next descriptor (quad word aligned), plus some
* additional bits (see PLX_DMA0_DESCRIPTOR_REG) */ * additional bits (see PLX_DMA0_DESCRIPTOR_REG) */
volatile uint32_t next; __le32 next;
}; };
/********************************************************************** /**********************************************************************
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#define BRCM_SHIFT(c, r, f) c##_##r##_##f##_SHIFT #define BRCM_SHIFT(c, r, f) c##_##r##_##f##_SHIFT
#define GET_FIELD(m, c, r, f) \ #define GET_FIELD(m, c, r, f) \
((((m) & BRCM_MASK(c, r, f)) >> BRCM_SHIFT(c, r, f)) << BRCM_ALIGN(c, r, f)) ((((m) & BRCM_MASK(c, r, f)) >> BRCM_SHIFT(c, r, f)) << \
BRCM_ALIGN(c, r, f))
#define SET_FIELD(m, c, r, f, d) \ #define SET_FIELD(m, c, r, f, d) \
((m) = (((m) & ~BRCM_MASK(c, r, f)) | ((((d) >> BRCM_ALIGN(c, r, f)) << \ ((m) = (((m) & ~BRCM_MASK(c, r, f)) | ((((d) >> BRCM_ALIGN(c, r, f)) << \
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include <linux/interrupt.h> /* For tasklet and interrupt structs/defines */ #include <linux/interrupt.h> /* For tasklet and interrupt structs/defines */
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <linux/termios.h> #include <linux/termios.h>
#include <asm/uaccess.h> /* For copy_from_user/copy_to_user */ #include <linux/uaccess.h> /* For copy_from_user/copy_to_user */
#include "dgnc_driver.h" #include "dgnc_driver.h"
#include "dgnc_pci.h" #include "dgnc_pci.h"
...@@ -77,8 +77,7 @@ int dgnc_mgmt_open(struct inode *inode, struct file *file) ...@@ -77,8 +77,7 @@ int dgnc_mgmt_open(struct inode *inode, struct file *file)
return -EBUSY; return -EBUSY;
} }
dgnc_mgmt_in_use[minor]++; dgnc_mgmt_in_use[minor]++;
} } else {
else {
DGNC_UNLOCK(dgnc_global_lock, lock_flags); DGNC_UNLOCK(dgnc_global_lock, lock_flags);
return -ENXIO; return -ENXIO;
} }
...@@ -107,9 +106,8 @@ int dgnc_mgmt_close(struct inode *inode, struct file *file) ...@@ -107,9 +106,8 @@ int dgnc_mgmt_close(struct inode *inode, struct file *file)
/* mgmt device */ /* mgmt device */
if (minor < MAXMGMTDEVICES) { if (minor < MAXMGMTDEVICES) {
if (dgnc_mgmt_in_use[minor]) { if (dgnc_mgmt_in_use[minor])
dgnc_mgmt_in_use[minor] = 0; dgnc_mgmt_in_use[minor] = 0;
}
} }
DGNC_UNLOCK(dgnc_global_lock, lock_flags); DGNC_UNLOCK(dgnc_global_lock, lock_flags);
...@@ -153,7 +151,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -153,7 +151,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
DPR_MGMT(("DIGI_GETDD returning numboards: %d version: %s\n", DPR_MGMT(("DIGI_GETDD returning numboards: %d version: %s\n",
ddi.dinfo_nboards, ddi.dinfo_version)); ddi.dinfo_nboards, ddi.dinfo_version));
if (copy_to_user(uarg, &ddi, sizeof (ddi))) if (copy_to_user(uarg, &ddi, sizeof(ddi)))
return -EFAULT; return -EFAULT;
break; break;
...@@ -165,9 +163,8 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -165,9 +163,8 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
struct digi_info di; struct digi_info di;
if (copy_from_user(&brd, uarg, sizeof(int))) { if (copy_from_user(&brd, uarg, sizeof(int)))
return -EFAULT; return -EFAULT;
}
DPR_MGMT(("DIGI_GETBD asking about board: %d\n", brd)); DPR_MGMT(("DIGI_GETBD asking about board: %d\n", brd));
...@@ -195,7 +192,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -195,7 +192,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
DPR_MGMT(("DIGI_GETBD returning type: %x state: %x ports: %x size: %x\n", DPR_MGMT(("DIGI_GETBD returning type: %x state: %x ports: %x size: %x\n",
di.info_bdtype, di.info_bdstate, di.info_nports, di.info_physsize)); di.info_bdtype, di.info_bdstate, di.info_nports, di.info_physsize));
if (copy_to_user(uarg, &di, sizeof (di))) if (copy_to_user(uarg, &di, sizeof(di)))
return -EFAULT; return -EFAULT;
break; break;
...@@ -209,9 +206,8 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -209,9 +206,8 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
uint board = 0; uint board = 0;
uint channel = 0; uint channel = 0;
if (copy_from_user(&ni, uarg, sizeof(ni))) { if (copy_from_user(&ni, uarg, sizeof(ni)))
return -EFAULT; return -EFAULT;
}
DPR_MGMT(("DIGI_GETBD asking about board: %d channel: %d\n", DPR_MGMT(("DIGI_GETBD asking about board: %d channel: %d\n",
ni.board, ni.channel)); ni.board, ni.channel));
......
...@@ -65,7 +65,9 @@ static ssize_t dgrp_class_pollrate_store(struct device *c, ...@@ -65,7 +65,9 @@ static ssize_t dgrp_class_pollrate_store(struct device *c,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
sscanf(buf, "0x%x\n", &dgrp_poll_tick); if (sscanf(buf, "0x%x\n", &dgrp_poll_tick) != 1)
return -EINVAL;
return count; return count;
} }
static DEVICE_ATTR(pollrate, 0600, dgrp_class_pollrate_show, static DEVICE_ATTR(pollrate, 0600, dgrp_class_pollrate_show,
......
...@@ -2798,6 +2798,7 @@ static int dgrp_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -2798,6 +2798,7 @@ static int dgrp_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
} }
/* pretend we didn't recognize this */ /* pretend we didn't recognize this */
/* fall-through */
case DIGI_SETA: case DIGI_SETA:
return dgrp_tty_digiseta(tty, (struct digi_struct *) arg); return dgrp_tty_digiseta(tty, (struct digi_struct *) arg);
......
...@@ -24,14 +24,6 @@ ...@@ -24,14 +24,6 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include "dot11d.h" #include "dot11d.h"
static u8 rsn_authen_cipher_suite[16][4] = {
{0x00, 0x0F, 0xAC, 0x00}, //Use group key, //Reserved
{0x00, 0x0F, 0xAC, 0x01}, //WEP-40 //RSNA default
{0x00, 0x0F, 0xAC, 0x02}, //TKIP //NONE //{used just as default}
{0x00, 0x0F, 0xAC, 0x03}, //WRAP-historical
{0x00, 0x0F, 0xAC, 0x04}, //CCMP
{0x00, 0x0F, 0xAC, 0x05}, //WEP-104
};
short ieee80211_is_54g(const struct ieee80211_network *net) short ieee80211_is_54g(const struct ieee80211_network *net)
{ {
......
...@@ -24,15 +24,6 @@ ...@@ -24,15 +24,6 @@
#include "dot11d.h" #include "dot11d.h"
u8 rsn_authen_cipher_suite[16][4] = {
{0x00,0x0F,0xAC,0x00}, //Use group key, //Reserved
{0x00,0x0F,0xAC,0x01}, //WEP-40 //RSNA default
{0x00,0x0F,0xAC,0x02}, //TKIP //NONE //{used just as default}
{0x00,0x0F,0xAC,0x03}, //WRAP-historical
{0x00,0x0F,0xAC,0x04}, //CCMP
{0x00,0x0F,0xAC,0x05}, //WEP-104
};
short ieee80211_is_54g(const struct ieee80211_network *net) short ieee80211_is_54g(const struct ieee80211_network *net)
{ {
return (net->rates_ex_len > 0) || (net->rates_len > 4); return (net->rates_ex_len > 0) || (net->rates_len > 4);
...@@ -1959,7 +1950,8 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1959,7 +1950,8 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
struct ieee80211_network network_resp; struct ieee80211_network network_resp;
struct ieee80211_network *network = &network_resp; struct ieee80211_network *network = &network_resp;
if (0 == (errcode=assoc_parse(ieee,skb, &aid))){ errcode = assoc_parse(ieee, skb, &aid);
if (!errcode) {
ieee->state=IEEE80211_LINKED; ieee->state=IEEE80211_LINKED;
ieee->assoc_id = aid; ieee->assoc_id = aid;
ieee->softmac_stats.rx_ass_ok++; ieee->softmac_stats.rx_ass_ok++;
...@@ -2017,7 +2009,8 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -2017,7 +2009,8 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
IEEE80211_DEBUG_MGMT("Received authentication response"); IEEE80211_DEBUG_MGMT("Received authentication response");
if (0 == (errcode=auth_parse(skb, &challenge, &chlen))){ errcode = auth_parse(skb, &challenge, &chlen);
if (!errcode) {
if(ieee->open_wep || !challenge){ if(ieee->open_wep || !challenge){
ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATED; ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATED;
ieee->softmac_stats.rx_auth_rs_ok++; ieee->softmac_stats.rx_auth_rs_ok++;
......
...@@ -1318,7 +1318,8 @@ static void rtl8192_tx_isr(struct urb *tx_urb) ...@@ -1318,7 +1318,8 @@ static void rtl8192_tx_isr(struct urb *tx_urb)
/* Don't send data frame during scanning.*/ /* Don't send data frame during scanning.*/
if ((skb_queue_len(&priv->ieee80211->skb_waitQ[queue_index]) != 0) && if ((skb_queue_len(&priv->ieee80211->skb_waitQ[queue_index]) != 0) &&
(!(priv->ieee80211->queue_stop))) { (!(priv->ieee80211->queue_stop))) {
if (NULL != (skb = skb_dequeue(&(priv->ieee80211->skb_waitQ[queue_index])))) skb = skb_dequeue(&(priv->ieee80211->skb_waitQ[queue_index]));
if (skb)
priv->ieee80211->softmac_hard_start_xmit(skb, dev); priv->ieee80211->softmac_hard_start_xmit(skb, dev);
return; //modified by david to avoid further processing AMSDU return; //modified by david to avoid further processing AMSDU
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "led.h" #include "led.h"
#include "dm.h" #include "dm.h"
u8 _rtl8821ae_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue) static u8 _rtl8821ae_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue)
{ {
u16 fc = rtl_get_fc(skb); u16 fc = rtl_get_fc(skb);
......
...@@ -473,7 +473,8 @@ static int reset_xd(struct rts51x_chip *chip) ...@@ -473,7 +473,8 @@ static int reset_xd(struct rts51x_chip *chip)
rts51x_add_cmd(chip, WRITE_REG_CMD, XD_DTCTL, 0xFF, rts51x_add_cmd(chip, WRITE_REG_CMD, XD_DTCTL, 0xFF,
XD_TIME_SETUP_STEP * 3 + XD_TIME_RW_STEP * XD_TIME_SETUP_STEP * 3 + XD_TIME_RW_STEP *
(2 + i + chip->option.rts51x_xd_rw_step) (2 + i + chip->option.rts51x_xd_rw_step)
+ XD_TIME_RWN_STEP * (i + chip->option.rts51x_xd_rwn_step)); + XD_TIME_RWN_STEP *
(i + chip->option.rts51x_xd_rwn_step));
rts51x_add_cmd(chip, WRITE_REG_CMD, XD_CATCTL, 0xFF, rts51x_add_cmd(chip, WRITE_REG_CMD, XD_CATCTL, 0xFF,
XD_TIME_SETUP_STEP * 3 + XD_TIME_RW_STEP * (4 + XD_TIME_SETUP_STEP * 3 + XD_TIME_RW_STEP * (4 +
i) + XD_TIME_RWN_STEP * (3 + i)); i) + XD_TIME_RWN_STEP * (3 + i));
...@@ -1526,8 +1527,8 @@ static int xd_read_multiple_pages(struct rts51x_chip *chip, u32 phy_blk, ...@@ -1526,8 +1527,8 @@ static int xd_read_multiple_pages(struct rts51x_chip *chip, u32 phy_blk,
rts51x_add_cmd(chip, WRITE_REG_CMD, XD_CHK_DATA_STATUS, rts51x_add_cmd(chip, WRITE_REG_CMD, XD_CHK_DATA_STATUS,
XD_AUTO_CHK_DATA_STATUS, XD_AUTO_CHK_DATA_STATUS); XD_AUTO_CHK_DATA_STATUS, XD_AUTO_CHK_DATA_STATUS);
rts51x_trans_dma_enable(chip->srb->sc_data_direction, chip, page_cnt * 512, rts51x_trans_dma_enable(chip->srb->sc_data_direction, chip,
DMA_512); page_cnt * 512, DMA_512);
rts51x_add_cmd(chip, WRITE_REG_CMD, XD_TRANSFER, 0xFF, rts51x_add_cmd(chip, WRITE_REG_CMD, XD_TRANSFER, 0xFF,
XD_TRANSFER_START | XD_READ_PAGES); XD_TRANSFER_START | XD_READ_PAGES);
...@@ -1745,8 +1746,8 @@ static int xd_write_multiple_pages(struct rts51x_chip *chip, u32 old_blk, ...@@ -1745,8 +1746,8 @@ static int xd_write_multiple_pages(struct rts51x_chip *chip, u32 old_blk,
rts51x_add_cmd(chip, WRITE_REG_CMD, CARD_DATA_SOURCE, 0x01, rts51x_add_cmd(chip, WRITE_REG_CMD, CARD_DATA_SOURCE, 0x01,
RING_BUFFER); RING_BUFFER);
rts51x_trans_dma_enable(chip->srb->sc_data_direction, chip, page_cnt * 512, rts51x_trans_dma_enable(chip->srb->sc_data_direction, chip,
DMA_512); page_cnt * 512, DMA_512);
rts51x_add_cmd(chip, WRITE_REG_CMD, XD_TRANSFER, 0xFF, rts51x_add_cmd(chip, WRITE_REG_CMD, XD_TRANSFER, 0xFF,
XD_TRANSFER_START | XD_WRITE_PAGES); XD_TRANSFER_START | XD_WRITE_PAGES);
...@@ -1842,8 +1843,8 @@ static int xd_delay_write(struct rts51x_chip *chip) ...@@ -1842,8 +1843,8 @@ static int xd_delay_write(struct rts51x_chip *chip)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int rts51x_xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, int rts51x_xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip,
u16 sector_cnt) u32 start_sector, u16 sector_cnt)
{ {
struct xd_info *xd_card = &(chip->xd_card); struct xd_info *xd_card = &(chip->xd_card);
unsigned int lun = SCSI_LUN(srb); unsigned int lun = SCSI_LUN(srb);
...@@ -1883,7 +1884,8 @@ int rts51x_xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sect ...@@ -1883,7 +1884,8 @@ int rts51x_xd_rw(struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sect
retval = xd_build_l2p_tbl(chip, zone_no); retval = xd_build_l2p_tbl(chip, zone_no);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
chip->card_fail |= XD_CARD; chip->card_fail |= XD_CARD;
rts51x_set_sense_type(chip, lun, SENSE_TYPE_MEDIA_NOT_PRESENT); rts51x_set_sense_type(chip, lun,
SENSE_TYPE_MEDIA_NOT_PRESENT);
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
} }
} }
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include "2t3e3.h" #include "2t3e3.h"
const u32 cpld_reg_map[][2] = const u32 cpld_reg_map[][2] = {
{
{ 0x0000, 0x0080 }, /* 0 - Port Control Register A (PCRA) */ { 0x0000, 0x0080 }, /* 0 - Port Control Register A (PCRA) */
{ 0x0004, 0x0084 }, /* 1 - Port Control Register B (PCRB) */ { 0x0004, 0x0084 }, /* 1 - Port Control Register B (PCRB) */
{ 0x0008, 0x0088 }, /* 2 - LCV Count Register (PLCR) */ { 0x0008, 0x0088 }, /* 2 - LCV Count Register (PLCR) */
...@@ -35,8 +34,7 @@ const u32 cpld_reg_map[][2] = ...@@ -35,8 +34,7 @@ const u32 cpld_reg_map[][2] =
{ 0x0070, 0x00f0 }, /* 17 - Port Bandwidth Stop (PBWL) */ { 0x0070, 0x00f0 }, /* 17 - Port Bandwidth Stop (PBWL) */
}; };
const u32 cpld_val_map[][2] = const u32 cpld_val_map[][2] = {
{
{ 0x01, 0x02 }, /* LIU1 / LIU2 select for Serial Chip Select */ { 0x01, 0x02 }, /* LIU1 / LIU2 select for Serial Chip Select */
{ 0x04, 0x08 }, /* DAC1 / DAC2 select for Serial Chip Select */ { 0x04, 0x08 }, /* DAC1 / DAC2 select for Serial Chip Select */
{ 0x00, 0x04 }, /* LOOP1 / LOOP2 - select of loop timing source */ { 0x00, 0x04 }, /* LOOP1 / LOOP2 - select of loop timing source */
...@@ -94,8 +92,7 @@ const u32 t3e3_framer_reg_map[] = { ...@@ -94,8 +92,7 @@ const u32 t3e3_framer_reg_map[] = {
0x81 /* 47 - LINE_INTERFACE_SCAN */ 0x81 /* 47 - LINE_INTERFACE_SCAN */
}; };
const u32 t3e3_liu_reg_map[] = const u32 t3e3_liu_reg_map[] = {
{
0x00, /* REG0 */ 0x00, /* REG0 */
0x01, /* REG1 */ 0x01, /* REG1 */
0x02, /* REG2 */ 0x02, /* REG2 */
......
...@@ -156,17 +156,6 @@ MODULE_DEVICE_TABLE(pci, slic_pci_tbl); ...@@ -156,17 +156,6 @@ MODULE_DEVICE_TABLE(pci, slic_pci_tbl);
_adapter->handle_lock.flags); \ _adapter->handle_lock.flags); \
} }
#define SLIC_FREE_SLIC_HANDLE(_adapter, _pslic_handle) \
{ \
_pslic_handle->type = SLIC_HANDLE_FREE; \
spin_lock_irqsave(&_adapter->handle_lock.lock, \
_adapter->handle_lock.flags); \
_pslic_handle->next = _adapter->pfree_slic_handles; \
_adapter->pfree_slic_handles = _pslic_handle; \
spin_unlock_irqrestore(&_adapter->handle_lock.lock, \
_adapter->handle_lock.flags); \
}
static inline void slic_reg32_write(void __iomem *reg, u32 value, bool flush) static inline void slic_reg32_write(void __iomem *reg, u32 value, bool flush)
{ {
writel(value, reg); writel(value, reg);
......
...@@ -1395,7 +1395,8 @@ int iwctl_giwpower(struct net_device *dev, struct iw_request_info *info, ...@@ -1395,7 +1395,8 @@ int iwctl_giwpower(struct net_device *dev, struct iw_request_info *info,
if (pMgmt == NULL) if (pMgmt == NULL)
return -EFAULT; return -EFAULT;
if ((wrq->disabled = (mode == WMAC_POWER_CAM))) wrq->disabled = (mode == WMAC_POWER_CAM);
if (wrq->disabled)
return 0; return 0;
if ((wrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) { if ((wrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) {
......
...@@ -1528,7 +1528,8 @@ int wl_put_ltv( struct wl_private *lp ) ...@@ -1528,7 +1528,8 @@ int wl_put_ltv( struct wl_private *lp )
hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord )); hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
/* Own Name (Station Nickname) */ /* Own Name (Station Nickname) */
if (( len = ( strlen( lp->StationName ) + 1 ) & ~0x01 ) != 0 ) { len = (strlen(lp->StationName) + 1) & ~0x01;
if (len != 0) {
//DBG_TRACE( DbgInfo, "CFG_CNF_OWN_NAME : %s\n", //DBG_TRACE( DbgInfo, "CFG_CNF_OWN_NAME : %s\n",
// lp->StationName ); // lp->StationName );
......
...@@ -219,82 +219,82 @@ ...@@ -219,82 +219,82 @@
/*-- Information Element Types --------------------*/ /*-- Information Element Types --------------------*/
/* prototype structure, all IEs start with these members */ /* prototype structure, all IEs start with these members */
typedef struct wlan_ie { struct wlan_ie {
u8 eid; u8 eid;
u8 len; u8 len;
} __packed wlan_ie_t; } __packed;
/*-- Service Set Identity (SSID) -----------------*/ /*-- Service Set Identity (SSID) -----------------*/
typedef struct wlan_ie_ssid { struct wlan_ie_ssid {
u8 eid; u8 eid;
u8 len; u8 len;
u8 ssid[1]; /* may be zero, ptrs may overlap */ u8 ssid[1]; /* may be zero, ptrs may overlap */
} __packed wlan_ie_ssid_t; } __packed;
/*-- Supported Rates -----------------------------*/ /*-- Supported Rates -----------------------------*/
typedef struct wlan_ie_supp_rates { struct wlan_ie_supp_rates {
u8 eid; u8 eid;
u8 len; u8 len;
u8 rates[1]; /* had better be at LEAST one! */ u8 rates[1]; /* had better be at LEAST one! */
} __packed wlan_ie_supp_rates_t; } __packed;
/*-- FH Parameter Set ----------------------------*/ /*-- FH Parameter Set ----------------------------*/
typedef struct wlan_ie_fh_parms { struct wlan_ie_fh_parms {
u8 eid; u8 eid;
u8 len; u8 len;
u16 dwell; u16 dwell;
u8 hopset; u8 hopset;
u8 hoppattern; u8 hoppattern;
u8 hopindex; u8 hopindex;
} __packed wlan_ie_fh_parms_t; } __packed;
/*-- DS Parameter Set ----------------------------*/ /*-- DS Parameter Set ----------------------------*/
typedef struct wlan_ie_ds_parms { struct wlan_ie_ds_parms {
u8 eid; u8 eid;
u8 len; u8 len;
u8 curr_ch; u8 curr_ch;
} __packed wlan_ie_ds_parms_t; } __packed;
/*-- CF Parameter Set ----------------------------*/ /*-- CF Parameter Set ----------------------------*/
typedef struct wlan_ie_cf_parms { struct wlan_ie_cf_parms {
u8 eid; u8 eid;
u8 len; u8 len;
u8 cfp_cnt; u8 cfp_cnt;
u8 cfp_period; u8 cfp_period;
u16 cfp_maxdur; u16 cfp_maxdur;
u16 cfp_durremaining; u16 cfp_durremaining;
} __packed wlan_ie_cf_parms_t; } __packed;
/*-- TIM ------------------------------------------*/ /*-- TIM ------------------------------------------*/
typedef struct wlan_ie_tim { struct wlan_ie_tim {
u8 eid; u8 eid;
u8 len; u8 len;
u8 dtim_cnt; u8 dtim_cnt;
u8 dtim_period; u8 dtim_period;
u8 bitmap_ctl; u8 bitmap_ctl;
u8 virt_bm[1]; u8 virt_bm[1];
} __packed wlan_ie_tim_t; } __packed;
/*-- IBSS Parameter Set ---------------------------*/ /*-- IBSS Parameter Set ---------------------------*/
typedef struct wlan_ie_ibss_parms { struct wlan_ie_ibss_parms {
u8 eid; u8 eid;
u8 len; u8 len;
u16 atim_win; u16 atim_win;
} __packed wlan_ie_ibss_parms_t; } __packed;
/*-- Challenge Text ------------------------------*/ /*-- Challenge Text ------------------------------*/
typedef struct wlan_ie_challenge { struct wlan_ie_challenge {
u8 eid; u8 eid;
u8 len; u8 len;
u8 challenge[1]; u8 challenge[1];
} __packed wlan_ie_challenge_t; } __packed;
/*-------------------------------------------------*/ /*-------------------------------------------------*/
/* Frame Types */ /* Frame Types */
/* prototype structure, all mgmt frame types will start with these members */ /* prototype structure, all mgmt frame types will start with these members */
typedef struct wlan_fr_mgmt { struct wlan_fr_mgmt {
u16 type; u16 type;
u16 len; /* DOES NOT include CRC !!!! */ u16 len; /* DOES NOT include CRC !!!! */
u8 *buf; u8 *buf;
...@@ -303,10 +303,10 @@ typedef struct wlan_fr_mgmt { ...@@ -303,10 +303,10 @@ typedef struct wlan_fr_mgmt {
void *priv; void *priv;
/*-- fixed fields -----------*/ /*-- fixed fields -----------*/
/*-- info elements ----------*/ /*-- info elements ----------*/
} wlan_fr_mgmt_t; };
/*-- Beacon ---------------------------------------*/ /*-- Beacon ---------------------------------------*/
typedef struct wlan_fr_beacon { struct wlan_fr_beacon {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -318,18 +318,18 @@ typedef struct wlan_fr_beacon { ...@@ -318,18 +318,18 @@ typedef struct wlan_fr_beacon {
u16 *bcn_int; u16 *bcn_int;
u16 *cap_info; u16 *cap_info;
/*-- info elements ----------*/ /*-- info elements ----------*/
wlan_ie_ssid_t *ssid; struct wlan_ie_ssid *ssid;
wlan_ie_supp_rates_t *supp_rates; struct wlan_ie_supp_rates *supp_rates;
wlan_ie_fh_parms_t *fh_parms; struct wlan_ie_fh_parms *fh_parms;
wlan_ie_ds_parms_t *ds_parms; struct wlan_ie_ds_parms *ds_parms;
wlan_ie_cf_parms_t *cf_parms; struct wlan_ie_cf_parms *cf_parms;
wlan_ie_ibss_parms_t *ibss_parms; struct wlan_ie_ibss_parms *ibss_parms;
wlan_ie_tim_t *tim; struct wlan_ie_tim *tim;
} wlan_fr_beacon_t; };
/*-- IBSS ATIM ------------------------------------*/ /*-- IBSS ATIM ------------------------------------*/
typedef struct wlan_fr_ibssatim { struct wlan_fr_ibssatim {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -342,10 +342,10 @@ typedef struct wlan_fr_ibssatim { ...@@ -342,10 +342,10 @@ typedef struct wlan_fr_ibssatim {
/* this frame type has a null body */ /* this frame type has a null body */
} wlan_fr_ibssatim_t; };
/*-- Disassociation -------------------------------*/ /*-- Disassociation -------------------------------*/
typedef struct wlan_fr_disassoc { struct wlan_fr_disassoc {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -357,10 +357,10 @@ typedef struct wlan_fr_disassoc { ...@@ -357,10 +357,10 @@ typedef struct wlan_fr_disassoc {
/*-- info elements ----------*/ /*-- info elements ----------*/
} wlan_fr_disassoc_t; };
/*-- Association Request --------------------------*/ /*-- Association Request --------------------------*/
typedef struct wlan_fr_assocreq { struct wlan_fr_assocreq {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -371,13 +371,13 @@ typedef struct wlan_fr_assocreq { ...@@ -371,13 +371,13 @@ typedef struct wlan_fr_assocreq {
u16 *cap_info; u16 *cap_info;
u16 *listen_int; u16 *listen_int;
/*-- info elements ----------*/ /*-- info elements ----------*/
wlan_ie_ssid_t *ssid; struct wlan_ie_ssid *ssid;
wlan_ie_supp_rates_t *supp_rates; struct wlan_ie_supp_rates *supp_rates;
} wlan_fr_assocreq_t; };
/*-- Association Response -------------------------*/ /*-- Association Response -------------------------*/
typedef struct wlan_fr_assocresp { struct wlan_fr_assocresp {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -389,12 +389,12 @@ typedef struct wlan_fr_assocresp { ...@@ -389,12 +389,12 @@ typedef struct wlan_fr_assocresp {
u16 *status; u16 *status;
u16 *aid; u16 *aid;
/*-- info elements ----------*/ /*-- info elements ----------*/
wlan_ie_supp_rates_t *supp_rates; struct wlan_ie_supp_rates *supp_rates;
} wlan_fr_assocresp_t; };
/*-- Reassociation Request ------------------------*/ /*-- Reassociation Request ------------------------*/
typedef struct wlan_fr_reassocreq { struct wlan_fr_reassocreq {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -406,13 +406,13 @@ typedef struct wlan_fr_reassocreq { ...@@ -406,13 +406,13 @@ typedef struct wlan_fr_reassocreq {
u16 *listen_int; u16 *listen_int;
u8 *curr_ap; u8 *curr_ap;
/*-- info elements ----------*/ /*-- info elements ----------*/
wlan_ie_ssid_t *ssid; struct wlan_ie_ssid *ssid;
wlan_ie_supp_rates_t *supp_rates; struct wlan_ie_supp_rates *supp_rates;
} wlan_fr_reassocreq_t; };
/*-- Reassociation Response -----------------------*/ /*-- Reassociation Response -----------------------*/
typedef struct wlan_fr_reassocresp { struct wlan_fr_reassocresp {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -424,12 +424,12 @@ typedef struct wlan_fr_reassocresp { ...@@ -424,12 +424,12 @@ typedef struct wlan_fr_reassocresp {
u16 *status; u16 *status;
u16 *aid; u16 *aid;
/*-- info elements ----------*/ /*-- info elements ----------*/
wlan_ie_supp_rates_t *supp_rates; struct wlan_ie_supp_rates *supp_rates;
} wlan_fr_reassocresp_t; };
/*-- Probe Request --------------------------------*/ /*-- Probe Request --------------------------------*/
typedef struct wlan_fr_probereq { struct wlan_fr_probereq {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -438,13 +438,13 @@ typedef struct wlan_fr_probereq { ...@@ -438,13 +438,13 @@ typedef struct wlan_fr_probereq {
void *priv; void *priv;
/*-- fixed fields -----------*/ /*-- fixed fields -----------*/
/*-- info elements ----------*/ /*-- info elements ----------*/
wlan_ie_ssid_t *ssid; struct wlan_ie_ssid *ssid;
wlan_ie_supp_rates_t *supp_rates; struct wlan_ie_supp_rates *supp_rates;
} wlan_fr_probereq_t; };
/*-- Probe Response -------------------------------*/ /*-- Probe Response -------------------------------*/
typedef struct wlan_fr_proberesp { struct wlan_fr_proberesp {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -456,16 +456,16 @@ typedef struct wlan_fr_proberesp { ...@@ -456,16 +456,16 @@ typedef struct wlan_fr_proberesp {
u16 *bcn_int; u16 *bcn_int;
u16 *cap_info; u16 *cap_info;
/*-- info elements ----------*/ /*-- info elements ----------*/
wlan_ie_ssid_t *ssid; struct wlan_ie_ssid *ssid;
wlan_ie_supp_rates_t *supp_rates; struct wlan_ie_supp_rates *supp_rates;
wlan_ie_fh_parms_t *fh_parms; struct wlan_ie_fh_parms *fh_parms;
wlan_ie_ds_parms_t *ds_parms; struct wlan_ie_ds_parms *ds_parms;
wlan_ie_cf_parms_t *cf_parms; struct wlan_ie_cf_parms *cf_parms;
wlan_ie_ibss_parms_t *ibss_parms; struct wlan_ie_ibss_parms *ibss_parms;
} wlan_fr_proberesp_t; };
/*-- Authentication -------------------------------*/ /*-- Authentication -------------------------------*/
typedef struct wlan_fr_authen { struct wlan_fr_authen {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -477,12 +477,12 @@ typedef struct wlan_fr_authen { ...@@ -477,12 +477,12 @@ typedef struct wlan_fr_authen {
u16 *auth_seq; u16 *auth_seq;
u16 *status; u16 *status;
/*-- info elements ----------*/ /*-- info elements ----------*/
wlan_ie_challenge_t *challenge; struct wlan_ie_challenge *challenge;
} wlan_fr_authen_t; };
/*-- Deauthenication -----------------------------*/ /*-- Deauthenication -----------------------------*/
typedef struct wlan_fr_deauthen { struct wlan_fr_deauthen {
u16 type; u16 type;
u16 len; u16 len;
u8 *buf; u8 *buf;
...@@ -494,27 +494,27 @@ typedef struct wlan_fr_deauthen { ...@@ -494,27 +494,27 @@ typedef struct wlan_fr_deauthen {
/*-- info elements ----------*/ /*-- info elements ----------*/
} wlan_fr_deauthen_t; };
void wlan_mgmt_encode_beacon(wlan_fr_beacon_t *f); void wlan_mgmt_encode_beacon(struct wlan_fr_beacon *f);
void wlan_mgmt_decode_beacon(wlan_fr_beacon_t *f); void wlan_mgmt_decode_beacon(struct wlan_fr_beacon *f);
void wlan_mgmt_encode_disassoc(wlan_fr_disassoc_t *f); void wlan_mgmt_encode_disassoc(struct wlan_fr_disassoc *f);
void wlan_mgmt_decode_disassoc(wlan_fr_disassoc_t *f); void wlan_mgmt_decode_disassoc(struct wlan_fr_disassoc *f);
void wlan_mgmt_encode_assocreq(wlan_fr_assocreq_t *f); void wlan_mgmt_encode_assocreq(struct wlan_fr_assocreq *f);
void wlan_mgmt_decode_assocreq(wlan_fr_assocreq_t *f); void wlan_mgmt_decode_assocreq(struct wlan_fr_assocreq *f);
void wlan_mgmt_encode_assocresp(wlan_fr_assocresp_t *f); void wlan_mgmt_encode_assocresp(struct wlan_fr_assocresp *f);
void wlan_mgmt_decode_assocresp(wlan_fr_assocresp_t *f); void wlan_mgmt_decode_assocresp(struct wlan_fr_assocresp *f);
void wlan_mgmt_encode_reassocreq(wlan_fr_reassocreq_t *f); void wlan_mgmt_encode_reassocreq(struct wlan_fr_reassocreq *f);
void wlan_mgmt_decode_reassocreq(wlan_fr_reassocreq_t *f); void wlan_mgmt_decode_reassocreq(struct wlan_fr_reassocreq *f);
void wlan_mgmt_encode_reassocresp(wlan_fr_reassocresp_t *f); void wlan_mgmt_encode_reassocresp(struct wlan_fr_reassocresp *f);
void wlan_mgmt_decode_reassocresp(wlan_fr_reassocresp_t *f); void wlan_mgmt_decode_reassocresp(struct wlan_fr_reassocresp *f);
void wlan_mgmt_encode_probereq(wlan_fr_probereq_t *f); void wlan_mgmt_encode_probereq(struct wlan_fr_probereq *f);
void wlan_mgmt_decode_probereq(wlan_fr_probereq_t *f); void wlan_mgmt_decode_probereq(struct wlan_fr_probereq *f);
void wlan_mgmt_encode_proberesp(wlan_fr_proberesp_t *f); void wlan_mgmt_encode_proberesp(struct wlan_fr_proberesp *f);
void wlan_mgmt_decode_proberesp(wlan_fr_proberesp_t *f); void wlan_mgmt_decode_proberesp(struct wlan_fr_proberesp *f);
void wlan_mgmt_encode_authen(wlan_fr_authen_t *f); void wlan_mgmt_encode_authen(struct wlan_fr_authen *f);
void wlan_mgmt_decode_authen(wlan_fr_authen_t *f); void wlan_mgmt_decode_authen(struct wlan_fr_authen *f);
void wlan_mgmt_encode_deauthen(wlan_fr_deauthen_t *f); void wlan_mgmt_encode_deauthen(struct wlan_fr_deauthen *f);
void wlan_mgmt_decode_deauthen(wlan_fr_deauthen_t *f); void wlan_mgmt_decode_deauthen(struct wlan_fr_deauthen *f);
#endif /* _P80211MGMT_H */ #endif /* _P80211MGMT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment