Skip to content

Commit

Permalink
Staging: wlan-ng: Replace BITx with the generic BIT(x)
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Moritz Muehlenhoff authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent ae26230 commit 7f6e0e4
Show file tree
Hide file tree
Showing 10 changed files with 138 additions and 172 deletions.
176 changes: 88 additions & 88 deletions drivers/staging/wlan-ng/hfa384x.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@
#define HFA384x_PORTTYPE_WDS ((u16)2)
#define HFA384x_PORTTYPE_PSUEDOIBSS ((u16)3)
#define HFA384x_PORTTYPE_HOSTAP ((u16)6)
#define HFA384x_WEPFLAGS_PRIVINVOKED ((u16)BIT0)
#define HFA384x_WEPFLAGS_EXCLUDE ((u16)BIT1)
#define HFA384x_WEPFLAGS_DISABLE_TXCRYPT ((u16)BIT4)
#define HFA384x_WEPFLAGS_DISABLE_RXCRYPT ((u16)BIT7)
#define HFA384x_WEPFLAGS_DISALLOW_MIXED ((u16)BIT11)
#define HFA384x_WEPFLAGS_PRIVINVOKED ((u16)BIT(0))
#define HFA384x_WEPFLAGS_EXCLUDE ((u16)BIT(1))
#define HFA384x_WEPFLAGS_DISABLE_TXCRYPT ((u16)BIT(4))
#define HFA384x_WEPFLAGS_DISABLE_RXCRYPT ((u16)BIT(7))
#define HFA384x_WEPFLAGS_DISALLOW_MIXED ((u16)BIT(11))
#define HFA384x_WEPFLAGS_IV_intERVAL1 ((u16)0)
#define HFA384x_WEPFLAGS_IV_intERVAL10 ((u16)BIT5)
#define HFA384x_WEPFLAGS_IV_intERVAL50 ((u16)BIT6)
#define HFA384x_WEPFLAGS_IV_intERVAL100 ((u16)(BIT5 | BIT6))
#define HFA384x_WEPFLAGS_FIRMWARE_WPA ((u16)BIT8)
#define HFA384x_WEPFLAGS_HOST_MIC ((u16)BIT9)
#define HFA384x_WEPFLAGS_IV_intERVAL10 ((u16)BIT(5))
#define HFA384x_WEPFLAGS_IV_intERVAL50 ((u16)BIT(6))
#define HFA384x_WEPFLAGS_IV_intERVAL100 ((u16)(BIT(5) | BIT(6)))
#define HFA384x_WEPFLAGS_FIRMWARE_WPA ((u16)BIT(8))
#define HFA384x_WEPFLAGS_HOST_MIC ((u16)BIT(9))
#define HFA384x_ROAMMODE_FWSCAN_FWROAM ((u16)1)
#define HFA384x_ROAMMODE_FWSCAN_HOSTROAM ((u16)2)
#define HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM ((u16)3)
Expand Down Expand Up @@ -248,59 +248,59 @@
#define HFA384x_PCI_M1_CTL_OFF (0xac)

/*--- Register Field Masks --------------------------*/
#define HFA384x_CMD_BUSY ((u16)BIT15)
#define HFA384x_CMD_AINFO ((u16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))
#define HFA384x_CMD_MACPORT ((u16)(BIT10 | BIT9 | BIT8))
#define HFA384x_CMD_RECL ((u16)BIT8)
#define HFA384x_CMD_WRITE ((u16)BIT8)
#define HFA384x_CMD_PROGMODE ((u16)(BIT9 | BIT8))
#define HFA384x_CMD_CMDCODE ((u16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))

#define HFA384x_STATUS_RESULT ((u16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))
#define HFA384x_STATUS_CMDCODE ((u16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))

#define HFA384x_OFFSET_BUSY ((u16)BIT15)
#define HFA384x_OFFSET_ERR ((u16)BIT14)
#define HFA384x_OFFSET_DATAOFF ((u16)(BIT11 | BIT10 | BIT9 | BIT8 | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1))

#define HFA384x_EVSTAT_TICK ((u16)BIT15)
#define HFA384x_EVSTAT_WTERR ((u16)BIT14)
#define HFA384x_EVSTAT_INFDROP ((u16)BIT13)
#define HFA384x_EVSTAT_INFO ((u16)BIT7)
#define HFA384x_EVSTAT_DTIM ((u16)BIT5)
#define HFA384x_EVSTAT_CMD ((u16)BIT4)
#define HFA384x_EVSTAT_ALLOC ((u16)BIT3)
#define HFA384x_EVSTAT_TXEXC ((u16)BIT2)
#define HFA384x_EVSTAT_TX ((u16)BIT1)
#define HFA384x_EVSTAT_RX ((u16)BIT0)
#define HFA384x_CMD_BUSY ((u16)BIT(15))
#define HFA384x_CMD_AINFO ((u16)(BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(8)))
#define HFA384x_CMD_MACPORT ((u16)(BIT(10) | BIT(9) | BIT(8)))
#define HFA384x_CMD_RECL ((u16)BIT(8))
#define HFA384x_CMD_WRITE ((u16)BIT(8))
#define HFA384x_CMD_PROGMODE ((u16)(BIT(9) | BIT(8)))
#define HFA384x_CMD_CMDCODE ((u16)(BIT(5) | BIT(4) | BIT(3) | BIT(2) | BIT(1) | BIT(0)))

#define HFA384x_STATUS_RESULT ((u16)(BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(8)))
#define HFA384x_STATUS_CMDCODE ((u16)(BIT(5) | BIT(4) | BIT(3) | BIT(2) | BIT(1) | BIT(0)))

#define HFA384x_OFFSET_BUSY ((u16)BIT(15))
#define HFA384x_OFFSET_ERR ((u16)BIT(14))
#define HFA384x_OFFSET_DATAOFF ((u16)(BIT(11) | BIT(10) | BIT(9) | BIT(8) | BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2) | BIT(1)))

#define HFA384x_EVSTAT_TICK ((u16)BIT(15))
#define HFA384x_EVSTAT_WTERR ((u16)BIT(14))
#define HFA384x_EVSTAT_INFDROP ((u16)BIT(13))
#define HFA384x_EVSTAT_INFO ((u16)BIT(7))
#define HFA384x_EVSTAT_DTIM ((u16)BIT(5))
#define HFA384x_EVSTAT_CMD ((u16)BIT(4))
#define HFA384x_EVSTAT_ALLOC ((u16)BIT(3))
#define HFA384x_EVSTAT_TXEXC ((u16)BIT(2))
#define HFA384x_EVSTAT_TX ((u16)BIT(1))
#define HFA384x_EVSTAT_RX ((u16)BIT(0)

#define HFA384x_int_BAP_OP (HFA384x_EVSTAT_INFO|HFA384x_EVSTAT_RX|HFA384x_EVSTAT_TX|HFA384x_EVSTAT_TXEXC)

#define HFA384x_int_NORMAL (HFA384x_EVSTAT_INFO|HFA384x_EVSTAT_RX|HFA384x_EVSTAT_TX|HFA384x_EVSTAT_TXEXC|HFA384x_EVSTAT_INFDROP|HFA384x_EVSTAT_ALLOC|HFA384x_EVSTAT_DTIM)

#define HFA384x_intEN_TICK ((u16)BIT15)
#define HFA384x_intEN_WTERR ((u16)BIT14)
#define HFA384x_intEN_INFDROP ((u16)BIT13)
#define HFA384x_intEN_INFO ((u16)BIT7)
#define HFA384x_intEN_DTIM ((u16)BIT5)
#define HFA384x_intEN_CMD ((u16)BIT4)
#define HFA384x_intEN_ALLOC ((u16)BIT3)
#define HFA384x_intEN_TXEXC ((u16)BIT2)
#define HFA384x_intEN_TX ((u16)BIT1)
#define HFA384x_intEN_RX ((u16)BIT0)

#define HFA384x_EVACK_TICK ((u16)BIT15)
#define HFA384x_EVACK_WTERR ((u16)BIT14)
#define HFA384x_EVACK_INFDROP ((u16)BIT13)
#define HFA384x_EVACK_INFO ((u16)BIT7)
#define HFA384x_EVACK_DTIM ((u16)BIT5)
#define HFA384x_EVACK_CMD ((u16)BIT4)
#define HFA384x_EVACK_ALLOC ((u16)BIT3)
#define HFA384x_EVACK_TXEXC ((u16)BIT2)
#define HFA384x_EVACK_TX ((u16)BIT1)
#define HFA384x_EVACK_RX ((u16)BIT0)

#define HFA384x_CONTROL_AUXEN ((u16)(BIT15 | BIT14))
#define HFA384x_intEN_TICK ((u16)BIT(15))
#define HFA384x_intEN_WTERR ((u16)BIT(14))
#define HFA384x_intEN_INFDROP ((u16)BIT(13))
#define HFA384x_intEN_INFO ((u16)BIT(7))
#define HFA384x_intEN_DTIM ((u16)BIT(5))
#define HFA384x_intEN_CMD ((u16)BIT(4))
#define HFA384x_intEN_ALLOC ((u16)BIT(3))
#define HFA384x_intEN_TXEXC ((u16)BIT(2))
#define HFA384x_intEN_TX ((u16)BIT(1))
#define HFA384x_intEN_RX ((u16)BIT(0)

#define HFA384x_EVACK_TICK ((u16)BIT(15))
#define HFA384x_EVACK_WTERR ((u16)BIT(14))
#define HFA384x_EVACK_INFDROP ((u16)BIT(13))
#define HFA384x_EVACK_INFO ((u16)BIT(7))
#define HFA384x_EVACK_DTIM ((u16)BIT(5))
#define HFA384x_EVACK_CMD ((u16)BIT(4))
#define HFA384x_EVACK_ALLOC ((u16)BIT(3))
#define HFA384x_EVACK_TXEXC ((u16)BIT(2))
#define HFA384x_EVACK_TX ((u16)BIT(1))
#define HFA384x_EVACK_RX ((u16)BIT(0)

#define HFA384x_CONTROL_AUXEN ((u16)(BIT(15) | BIT(14)))


/*--- Command Code Constants --------------------------*/
Expand Down Expand Up @@ -883,11 +883,11 @@ PD Record codes
/*=============================================================*/
/*------ Types and their related constants --------------------*/

#define HFA384x_HOSTAUTHASSOC_HOSTAUTH BIT0
#define HFA384x_HOSTAUTHASSOC_HOSTASSOC BIT1
#define HFA384x_HOSTAUTHASSOC_HOSTAUTH BIT(0)
#define HFA384x_HOSTAUTHASSOC_HOSTASSOC BIT(1)

#define HFA384x_WHAHANDLING_DISABLED 0
#define HFA384x_WHAHANDLING_PASSTHROUGH BIT1
#define HFA384x_WHAHANDLING_PASSTHROUGH BIT(1)

/*-------------------------------------------------------------*/
/* Commonly used basic types */
Expand Down Expand Up @@ -1518,11 +1518,11 @@ typedef struct hfa384x_LFOStatus
u16 VRHFOResult;
} __attribute__((packed)) hfa384x_LFOStatus_t;

#define HFA384x_TESTRESULT_ALLPASSED BIT0
#define HFA384x_TESTRESULT_LFO_FAIL BIT1
#define HFA384x_TESTRESULT_VR_HF0_FAIL BIT2
#define HFA384x_HOST_FIRM_COORDINATE BIT7
#define HFA384x_TESTRESULT_COORDINATE BIT15
#define HFA384x_TESTRESULT_ALLPASSED BIT(0)
#define HFA384x_TESTRESULT_LFO_FAIL BIT(1)
#define HFA384x_TESTRESULT_VR_HF0_FAIL BIT(2)
#define HFA384x_HOST_FIRM_COORDINATE BIT(7)
#define HFA384x_TESTRESULT_COORDINATE BIT(15)

/*-- Information Record: LEDControl --*/
typedef struct hfa384x_LEDControl
Expand Down Expand Up @@ -1606,20 +1606,20 @@ typedef struct hfa384x_tx_frame
Communication Frames: Field Masks for Transmit Frames
--------------------------------------------------------------------*/
/*-- Status Field --*/
#define HFA384x_TXSTATUS_ACKERR ((u16)BIT5)
#define HFA384x_TXSTATUS_FORMERR ((u16)BIT3)
#define HFA384x_TXSTATUS_DISCON ((u16)BIT2)
#define HFA384x_TXSTATUS_AGEDERR ((u16)BIT1)
#define HFA384x_TXSTATUS_RETRYERR ((u16)BIT0)
#define HFA384x_TXSTATUS_ACKERR ((u16)BIT(5))
#define HFA384x_TXSTATUS_FORMERR ((u16)BIT(3))
#define HFA384x_TXSTATUS_DISCON ((u16)BIT(2))
#define HFA384x_TXSTATUS_AGEDERR ((u16)BIT(1))
#define HFA384x_TXSTATUS_RETRYERR ((u16)BIT(0))
/*-- Transmit Control Field --*/
#define HFA384x_TX_CFPOLL ((u16)BIT12)
#define HFA384x_TX_PRST ((u16)BIT11)
#define HFA384x_TX_MACPORT ((u16)(BIT10 | BIT9 | BIT8))
#define HFA384x_TX_NOENCRYPT ((u16)BIT7)
#define HFA384x_TX_RETRYSTRAT ((u16)(BIT6 | BIT5))
#define HFA384x_TX_STRUCTYPE ((u16)(BIT4 | BIT3))
#define HFA384x_TX_TXEX ((u16)BIT2)
#define HFA384x_TX_TXOK ((u16)BIT1)
#define HFA384x_TX_CFPOLL ((u16)BIT(12))
#define HFA384x_TX_PRST ((u16)BIT(11))
#define HFA384x_TX_MACPORT ((u16)(BIT(10) | BIT(9) | BIT(8)))
#define HFA384x_TX_NOENCRYPT ((u16)BIT(7))
#define HFA384x_TX_RETRYSTRAT ((u16)(BIT(6) | BIT(5)))
#define HFA384x_TX_STRUCTYPE ((u16)(BIT(4) | BIT(3)))
#define HFA384x_TX_TXEX ((u16)BIT(2))
#define HFA384x_TX_TXOK ((u16)BIT(1))
/*--------------------------------------------------------------------
Communication Frames: Test/Get/Set Field Values for Transmit Frames
--------------------------------------------------------------------*/
Expand Down Expand Up @@ -1695,10 +1695,10 @@ Communication Frames: Field Masks for Receive Frames
#define HFA384x_RX_DATA_OFF ((u16)60)

/*-- Status Fields --*/
#define HFA384x_RXSTATUS_MSGTYPE ((u16)(BIT15 | BIT14 | BIT13))
#define HFA384x_RXSTATUS_MACPORT ((u16)(BIT10 | BIT9 | BIT8))
#define HFA384x_RXSTATUS_UNDECR ((u16)BIT1)
#define HFA384x_RXSTATUS_FCSERR ((u16)BIT0)
#define HFA384x_RXSTATUS_MSGTYPE ((u16)(BIT(15) | BIT(14) | BIT(13)))
#define HFA384x_RXSTATUS_MACPORT ((u16)(BIT(10) | BIT(9) | BIT(8)))
#define HFA384x_RXSTATUS_UNDECR ((u16)BIT(1))
#define HFA384x_RXSTATUS_FCSERR ((u16)BIT(0))
/*--------------------------------------------------------------------
Communication Frames: Test/Get/Set Field Values for Receive Frames
--------------------------------------------------------------------*/
Expand Down Expand Up @@ -1822,8 +1822,8 @@ typedef struct hfa384x_ChInfoResultSub
u16 active;
} __attribute__((packed)) hfa384x_ChInfoResultSub_t;

#define HFA384x_CHINFORESULT_BSSACTIVE BIT0
#define HFA384x_CHINFORESULT_PCFACTIVE BIT1
#define HFA384x_CHINFORESULT_BSSACTIVE BIT(0)
#define HFA384x_CHINFORESULT_PCFACTIVE BIT(1)

typedef struct hfa384x_ChInfoResult
{
Expand Down Expand Up @@ -2444,9 +2444,9 @@ typedef struct hfa484x_metacmd
#define MAX_GRP_ADDR 32
#define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */

#define MM_SAT_PCF (BIT14)
#define MM_GCSD_PCF (BIT15)
#define MM_GCSD_PCF_EB (BIT14 | BIT15)
#define MM_SAT_PCF (BIT(14))
#define MM_GCSD_PCF (BIT(15))
#define MM_GCSD_PCF_EB (BIT(14) | BIT(15))

#define WLAN_STATE_STOPPED 0 /* Network is not active. */
#define WLAN_STATE_STARTED 1 /* Network has been started. */
Expand Down
28 changes: 14 additions & 14 deletions drivers/staging/wlan-ng/p80211hdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@
/* SET_FC_FSTYPE(WLAN_FSTYPE_RTS) ); */
/*------------------------------------------------------------*/

#define WLAN_GET_FC_PVER(n) (((u16)(n)) & (BIT0 | BIT1))
#define WLAN_GET_FC_FTYPE(n) ((((u16)(n)) & (BIT2 | BIT3)) >> 2)
#define WLAN_GET_FC_FSTYPE(n) ((((u16)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4)
#define WLAN_GET_FC_TODS(n) ((((u16)(n)) & (BIT8)) >> 8)
#define WLAN_GET_FC_FROMDS(n) ((((u16)(n)) & (BIT9)) >> 9)
#define WLAN_GET_FC_MOREFRAG(n) ((((u16)(n)) & (BIT10)) >> 10)
#define WLAN_GET_FC_RETRY(n) ((((u16)(n)) & (BIT11)) >> 11)
#define WLAN_GET_FC_PWRMGT(n) ((((u16)(n)) & (BIT12)) >> 12)
#define WLAN_GET_FC_MOREDATA(n) ((((u16)(n)) & (BIT13)) >> 13)
#define WLAN_GET_FC_ISWEP(n) ((((u16)(n)) & (BIT14)) >> 14)
#define WLAN_GET_FC_ORDER(n) ((((u16)(n)) & (BIT15)) >> 15)
#define WLAN_GET_FC_PVER(n) (((u16)(n)) & (BIT(0) | BIT(1)))
#define WLAN_GET_FC_FTYPE(n) ((((u16)(n)) & (BIT(2) | BIT(3))) >> 2)
#define WLAN_GET_FC_FSTYPE(n) ((((u16)(n)) & (BIT(4)|BIT(5)|BIT(6)|BIT(7))) >> 4)
#define WLAN_GET_FC_TODS(n) ((((u16)(n)) & (BIT(8))) >> 8)
#define WLAN_GET_FC_FROMDS(n) ((((u16)(n)) & (BIT(9))) >> 9)
#define WLAN_GET_FC_MOREFRAG(n) ((((u16)(n)) & (BIT(10))) >> 10)
#define WLAN_GET_FC_RETRY(n) ((((u16)(n)) & (BIT(11))) >> 11)
#define WLAN_GET_FC_PWRMGT(n) ((((u16)(n)) & (BIT(12))) >> 12)
#define WLAN_GET_FC_MOREDATA(n) ((((u16)(n)) & (BIT(13))) >> 13)
#define WLAN_GET_FC_ISWEP(n) ((((u16)(n)) & (BIT(14))) >> 14)
#define WLAN_GET_FC_ORDER(n) ((((u16)(n)) & (BIT(15))) >> 15)

#define WLAN_SET_FC_PVER(n) ((u16)(n))
#define WLAN_SET_FC_FTYPE(n) (((u16)(n)) << 2)
Expand All @@ -202,8 +202,8 @@
/* Macros to get/set the bitfields of the Sequence Control */
/* Field. */
/*------------------------------------------------------------*/
#define WLAN_GET_SEQ_FRGNUM(n) (((u16)(n)) & (BIT0|BIT1|BIT2|BIT3))
#define WLAN_GET_SEQ_SEQNUM(n) ((((u16)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4)
#define WLAN_GET_SEQ_FRGNUM(n) (((u16)(n)) & (BIT(0)|BIT(1)|BIT(2)|BIT(3)))
#define WLAN_GET_SEQ_SEQNUM(n) ((((u16)(n)) & (~(BIT(0)|BIT(1)|BIT(2)|BIT(3)))) >> 4)

/*--- Data ptr macro -----------------------------------------*/
/* Creates a u8* to the data portion of a frame */
Expand All @@ -212,7 +212,7 @@
#define WLAN_HDR_A3_DATAP(p) (((u8*)(p)) + WLAN_HDR_A3_LEN)
#define WLAN_HDR_A4_DATAP(p) (((u8*)(p)) + WLAN_HDR_A4_LEN)

#define DOT11_RATE5_ISBASIC_GET(r) (((u8)(r)) & BIT7)
#define DOT11_RATE5_ISBASIC_GET(r) (((u8)(r)) & BIT(7))

/*================================================================*/
/* Types */
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/wlan-ng/p80211ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@
/*----------------------------------------------------------------*/
/* Netlink multicast bits for different types of messages */

#define P80211_NL_MCAST_GRP_MLME BIT0 /* Local station messages */
#define P80211_NL_MCAST_GRP_SNIFF BIT1 /* Sniffer messages */
#define P80211_NL_MCAST_GRP_DIST BIT2 /* Distribution system messages */
#define P80211_NL_MCAST_GRP_MLME BIT(0) /* Local station messages */
#define P80211_NL_MCAST_GRP_SNIFF BIT(1) /* Sniffer messages */
#define P80211_NL_MCAST_GRP_DIST BIT(2) /* Distribution system messages */

/*================================================================*/
/* Types */
Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/wlan-ng/p80211mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@
/* Macros */

/*-- Capability Field ---------------------------*/
#define WLAN_GET_MGMT_CAP_INFO_ESS(n) ((n) & BIT0)
#define WLAN_GET_MGMT_CAP_INFO_IBSS(n) (((n) & BIT1) >> 1)
#define WLAN_GET_MGMT_CAP_INFO_CFPOLLABLE(n) (((n) & BIT2) >> 2)
#define WLAN_GET_MGMT_CAP_INFO_CFPOLLREQ(n) (((n) & BIT3) >> 3)
#define WLAN_GET_MGMT_CAP_INFO_PRIVACY(n) (((n) & BIT4) >> 4)
#define WLAN_GET_MGMT_CAP_INFO_ESS(n) ((n) & BIT(0))
#define WLAN_GET_MGMT_CAP_INFO_IBSS(n) (((n) & BIT(1)) >> 1)
#define WLAN_GET_MGMT_CAP_INFO_CFPOLLABLE(n) (((n) & BIT(2)) >> 2)
#define WLAN_GET_MGMT_CAP_INFO_CFPOLLREQ(n) (((n) & BIT(3)) >> 3)
#define WLAN_GET_MGMT_CAP_INFO_PRIVACY(n) (((n) & BIT(4)) >> 4)
/* p80211b additions */
#define WLAN_GET_MGMT_CAP_INFO_SHORT(n) (((n) & BIT5) >> 5)
#define WLAN_GET_MGMT_CAP_INFO_PBCC(n) (((n) & BIT6) >> 6)
#define WLAN_GET_MGMT_CAP_INFO_AGILITY(n) (((n) & BIT7) >> 7)
#define WLAN_GET_MGMT_CAP_INFO_SHORT(n) (((n) & BIT(5)) >> 5)
#define WLAN_GET_MGMT_CAP_INFO_PBCC(n) (((n) & BIT(6)) >> 6)
#define WLAN_GET_MGMT_CAP_INFO_AGILITY(n) (((n) & BIT(7)) >> 7)

#define WLAN_SET_MGMT_CAP_INFO_ESS(n) (n)
#define WLAN_SET_MGMT_CAP_INFO_IBSS(n) ((n) << 1)
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/wlan-ng/p80211netdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ int p80211wext_event_associated(struct wlandevice *wlandev, int assoc);
#define NUM_WEPKEYS 4
#define MAX_KEYLEN 32

#define HOSTWEP_DEFAULTKEY_MASK (BIT1|BIT0)
#define HOSTWEP_DECRYPT BIT4
#define HOSTWEP_ENCRYPT BIT5
#define HOSTWEP_PRIVACYINVOKED BIT6
#define HOSTWEP_EXCLUDEUNENCRYPTED BIT7
#define HOSTWEP_DEFAULTKEY_MASK (BIT(1)|BIT(0))
#define HOSTWEP_DECRYPT BIT(4)
#define HOSTWEP_ENCRYPT BIT(5)
#define HOSTWEP_PRIVACYINVOKED BIT(6)
#define HOSTWEP_EXCLUDEUNENCRYPTED BIT(7)

extern int wlan_watchdog;
extern int wlan_wext_write;
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/wlan-ng/p80211wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include <asm/uaccess.h>
#include <asm/byteorder.h>
#include <linux/if_ether.h>
#include <linux/bitops.h>

/*================================================================*/
/* Project Includes */
Expand Down Expand Up @@ -126,7 +127,7 @@ static const long p80211wext_channel_freq[] = {
#define NUM_CHANNELS ARRAY_SIZE(p80211wext_channel_freq)

/* steal a spare bit to store the shared/opensystems state. should default to open if not set */
#define HOSTWEP_SHAREDKEY BIT3
#define HOSTWEP_SHAREDKEY BIT(3)


/** function declarations =============== */
Expand Down
11 changes: 6 additions & 5 deletions drivers/staging/wlan-ng/prism2mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
#include <asm/byteorder.h>
#include <linux/random.h>
#include <linux/usb.h>
#include <linux/bitops.h>

#include "wlan_compat.h"

Expand All @@ -94,10 +95,10 @@
#include "prism2mgmt.h"

/* Converts 802.11 format rate specifications to prism2 */
#define p80211rate_to_p2bit(n) ((((n)&~BIT7) == 2) ? BIT0 : \
(((n)&~BIT7) == 4) ? BIT1 : \
(((n)&~BIT7) == 11) ? BIT2 : \
(((n)&~BIT7) == 22) ? BIT3 : 0)
#define p80211rate_to_p2bit(n) ((((n)&~BIT(7)) == 2) ? BIT(0) : \
(((n)&~BIT(7)) == 4) ? BIT(1) : \
(((n)&~BIT(7)) == 11) ? BIT(2) : \
(((n)&~BIT(7)) == 22) ? BIT(3) : 0)

/*----------------------------------------------------------------
* prism2mgmt_scan
Expand Down Expand Up @@ -196,7 +197,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
for (i = 0; i < msg->channellist.data.len; i++) {
u8 channel = msg->channellist.data.data[i];
if (channel > 14) continue;
/* channel 1 is BIT0 ... channel 14 is BIT13 */
/* channel 1 is BIT 0 ... channel 14 is BIT 13 */
word |= (1 << (channel-1));
}
scanreq.channelList = host2hfa384x_16(word);
Expand Down
Loading

0 comments on commit 7f6e0e4

Please sign in to comment.