staging: vt6655: CARDvUpdateBasicTopRate use basic_rates to find top rate
PATCH 1/10 staging: vt6655: CARDvUpdateBasicTopRate use basic_rates to find top rate
basic_rates should now be used to find it.
--- drivers/staging/vt6655/card.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6655/card.c +2 -2
@@ -843,7 +843,7 @@ void CARDvUpdateBasicTopRate(struct vnt_private *pDevice)/* Determines the highest basic rate. */ for (ii =RATE_54M ; ii >=RATE_6M ; ii--) { -if ((pDevice->wBasicRate) & ((unsigned short )(1 <<ii))) { +if ((pDevice->basic_rates) & ((u32)(1 << ii))) { byTopOFDM = ii;break ; }
@@ -851,7 +851,7 @@ void CARDvUpdateBasicTopRate(struct vnt_private *pDevice) pDevice->byTopOFDMBasicRate = byTopOFDM;for (ii =RATE_11M ;; ii--) { -if ((pDevice->wBasicRate) & ((unsigned short )(1 <<ii))) { +if ((pDevice->basic_rates) & ((u32)(1 << ii))) { byTopCCK = ii;break ; }
Signature · 1 line
2.1.0
PATCH 2/10 staging: vt6655: dead code remove CARDbAddBasicRate
we nonlonger set rates in the driver
--- drivers/staging/vt6655/card.c | 12 ------------ drivers/staging/vt6655/card.h | 1 - 2 files changed, 13 deletions(-)
drivers/staging/vt6655/card.c +0 -12
@@ -861,18 +861,6 @@ void CARDvUpdateBasicTopRate(struct vnt_private *pDevice) pDevice->byTopCCKBasicRate = byTopCCK; } -bool CARDbAddBasicRate (struct vnt_private *pDevice,unsigned short wRateIdx) -{ -unsigned short wRate = (unsigned short )(1 <<wRateIdx); - - pDevice->wBasicRate |= wRate; - -/* Determines the highest basic rate. */ -CARDvUpdateBasicTopRate ((void *)pDevice); - -return true; -} -bool CARDbIsOFDMinBasicRate (struct vnt_private *pDevice) {int ii;
drivers/staging/vt6655/card.h +0 -1
@@ -76,7 +76,6 @@ struct vnt_private;void CARDvSetRSPINF (struct vnt_private *,CARD_PHY_TYPE ePHYType);void vUpdateIFS (struct vnt_private *);void CARDvUpdateBasicTopRate (struct vnt_private *); -bool CARDbAddBasicRate (struct vnt_private *,unsigned short wRateIdx);bool CARDbIsOFDMinBasicRate (struct vnt_private *);void CARDvSetLoopbackMode (void __iomem *dwIoBase,unsigned short wLoopbackMode);bool CARDbSoftwareReset (struct vnt_private *);
Signature · 1 line
2.1.0
PATCH 3/10 staging: vt6655: CARDbSetPhyParameter change CARD_PHY_TYPE to bb_type
In reply to Malcolm Priestleyusing u8 for bb_type
--- drivers/staging/vt6655/card.c | 8 ++++---- drivers/staging/vt6655/card.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/vt6655/card.c +4 -4
@@ -204,7 +204,7 @@ s_vCalculateOFDMRParameter(* * Return Value: None. */ -bool CARDbSetPhyParameter (struct vnt_private *pDevice,CARD_PHY_TYPE ePHYType, +bool CARDbSetPhyParameter (struct vnt_private *pDevice,u8 bb_type,unsigned short wCapInfo,unsigned char byERPField,void *pvSupportRateIEs,void *pvExtSupportRateIEs) {
@@ -216,7 +216,7 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, CARD_PHY_TYPE ePHYType,int i;/* Set SIFS, DIFS, EIFS, SlotTime, CwMin */ -if (ePHYType ==PHY_TYPE_11A ) { +if (bb_type ==BB_TYPE_11A ) {if (pDevice->byRFType ==RF_AIROHA7230 ) {/* AL7230 use single PAPE and connect to PAPE_2.4G */ MACvSetBBType (pDevice->PortOffset,BB_TYPE_11G );
@@ -243,7 +243,7 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, CARD_PHY_TYPE ePHYType, bySIFS =C_SIFS_A ; byDIFS =C_SIFS_A +2 *C_SLOT_SHORT ; byCWMaxMin =0xA4 ; - }else if (ePHYType ==PHY_TYPE_11B ) { + }else if (bb_type ==BB_TYPE_11B ) {MACvSetBBType (pDevice->PortOffset,BB_TYPE_11B );if (pDevice->byRFType ==RF_AIROHA7230 ) { pDevice->abyBBVGA[0 ] =0x1C ;
@@ -344,7 +344,7 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, CARD_PHY_TYPE ePHYType, pDevice->byPacketType =CARDbyGetPktType (pDevice); -CARDvSetRSPINF (pDevice, ePHYType); +CARDvSetRSPINF (pDevice, bb_type);return true; }
drivers/staging/vt6655/card.h +1 -1
@@ -89,7 +89,7 @@ void CARDvSafeResetTx(struct vnt_private *);void CARDvSafeResetRx (struct vnt_private *);bool CARDbRadioPowerOff (struct vnt_private *);bool CARDbRadioPowerOn (struct vnt_private *); -bool CARDbSetPhyParameter (struct vnt_private *,CARD_PHY_TYPE ePHYType, +bool CARDbSetPhyParameter (struct vnt_private *,u8 ,unsigned short wCapInfo,unsigned char byERPField,void *pvSupportRateIEs,void *pvExtSupportRateIEs); bool CARDbUpdateTSF(struct vnt_private *, unsigned char byRxRate,
Signature · 1 line
2.1.0
PATCH 4/10 staging: vt6655: CARDvSetRSPINF us bb_type for CARD_PHY_TYPE
In reply to Malcolm PriestleyUsing u8 for bb_type
--- drivers/staging/vt6655/card.c | 20 ++++++++++---------- drivers/staging/vt6655/card.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/vt6655/card.c +10 -10
@@ -669,7 +669,7 @@ static unsigned short CARDwGetOFDMControlRate(struct vnt_private *pDevice,* * Return Value: None. */ -void CARDvSetRSPINF (struct vnt_private *pDevice,CARD_PHY_TYPE ePHYType) +void CARDvSetRSPINF (struct vnt_private *pDevice,u8 bb_type) {union vnt_phy_field_swap phy;unsigned char byTxRate, byRsvTime;/* For OFDM */
@@ -716,55 +716,55 @@ void CARDvSetRSPINF(struct vnt_private *pDevice, CARD_PHY_TYPE ePHYType)/* RSPINF_a_6 */ s_vCalculateOFDMRParameter (RATE_6M , - ePHYType, + bb_type, &byTxRate, &byRsvTime);VNSvOutPortW (pDevice->PortOffset +MAC_REG_RSPINF_A_6 ,MAKEWORD (byTxRate, byRsvTime));/* RSPINF_a_9 */ s_vCalculateOFDMRParameter (RATE_9M , - ePHYType, + bb_type, &byTxRate, &byRsvTime);VNSvOutPortW (pDevice->PortOffset +MAC_REG_RSPINF_A_9 ,MAKEWORD (byTxRate, byRsvTime));/* RSPINF_a_12 */ s_vCalculateOFDMRParameter (RATE_12M , - ePHYType, + bb_type, &byTxRate, &byRsvTime);VNSvOutPortW (pDevice->PortOffset +MAC_REG_RSPINF_A_12 ,MAKEWORD (byTxRate, byRsvTime));/* RSPINF_a_18 */ s_vCalculateOFDMRParameter (RATE_18M , - ePHYType, + bb_type, &byTxRate, &byRsvTime);VNSvOutPortW (pDevice->PortOffset +MAC_REG_RSPINF_A_18 ,MAKEWORD (byTxRate, byRsvTime));/* RSPINF_a_24 */ s_vCalculateOFDMRParameter (RATE_24M , - ePHYType, + bb_type, &byTxRate, &byRsvTime);VNSvOutPortW (pDevice->PortOffset +MAC_REG_RSPINF_A_24 ,MAKEWORD (byTxRate, byRsvTime));/* RSPINF_a_36 */ s_vCalculateOFDMRParameter (CARDwGetOFDMControlRate ((void *)pDevice,RATE_36M ), - ePHYType, + bb_type, &byTxRate, &byRsvTime);VNSvOutPortW (pDevice->PortOffset +MAC_REG_RSPINF_A_36 ,MAKEWORD (byTxRate, byRsvTime));/* RSPINF_a_48 */ s_vCalculateOFDMRParameter (CARDwGetOFDMControlRate ((void *)pDevice,RATE_48M ), - ePHYType, + bb_type, &byTxRate, &byRsvTime);VNSvOutPortW (pDevice->PortOffset +MAC_REG_RSPINF_A_48 ,MAKEWORD (byTxRate, byRsvTime));/* RSPINF_a_54 */ s_vCalculateOFDMRParameter (CARDwGetOFDMControlRate ((void *)pDevice,RATE_54M ), - ePHYType, + bb_type, &byTxRate, &byRsvTime);VNSvOutPortW (pDevice->PortOffset +MAC_REG_RSPINF_A_54 ,MAKEWORD (byTxRate, byRsvTime));/* RSPINF_a_72 */ s_vCalculateOFDMRParameter (CARDwGetOFDMControlRate ((void *)pDevice,RATE_54M ), - ePHYType, + bb_type, &byTxRate, &byRsvTime);VNSvOutPortW (pDevice->PortOffset +MAC_REG_RSPINF_A_72 ,MAKEWORD (byTxRate, byRsvTime));
drivers/staging/vt6655/card.h +1 -1
@@ -73,7 +73,7 @@ typedef enum _CARD_STATUS_TYPE {struct vnt_private ; -void CARDvSetRSPINF (struct vnt_private *,CARD_PHY_TYPE ePHYType); +void CARDvSetRSPINF (struct vnt_private *,u8 );void vUpdateIFS (struct vnt_private *);void CARDvUpdateBasicTopRate (struct vnt_private *);bool CARDbIsOFDMinBasicRate (struct vnt_private *);
Signature · 1 line
2.1.0
PATCH 5/10 staging: vt6655: s_vCalculateOFDMRParameter use bb_type for CARD_PHY_TYPE
In reply to Malcolm Priestleyusing u8 for bb_type and replacing PHY_TYPE_11A with BB_TYPE_11A
--- drivers/staging/vt6655/card.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/vt6655/card.c +10 -10
@@ -78,7 +78,7 @@ staticvoid s_vCalculateOFDMRParameter (unsigned char byRate, -CARD_PHY_TYPE ePHYType, +u8 bb_type,unsigned char *pbyTxRate,unsigned char *pbyRsvTime );
@@ -102,14 +102,14 @@ staticvoid s_vCalculateOFDMRParameter (unsigned char byRate, -CARD_PHY_TYPE ePHYType, +u8 bb_type,unsigned char *pbyTxRate,unsigned char *pbyRsvTime ) {switch (byRate) {case RATE_6M : -if (ePHYType ==PHY_TYPE_11A ) {/* 5GHZ */ +if (bb_type ==BB_TYPE_11A ) {/* 5GHZ */ *pbyTxRate =0x9B ; *pbyRsvTime =44 ; }else {
@@ -119,7 +119,7 @@ s_vCalculateOFDMRParameter(break ;case RATE_9M : -if (ePHYType ==PHY_TYPE_11A ) {/* 5GHZ */ +if (bb_type ==BB_TYPE_11A ) {/* 5GHZ */ *pbyTxRate =0x9F ; *pbyRsvTime =36 ; }else {
@@ -129,7 +129,7 @@ s_vCalculateOFDMRParameter(break ;case RATE_12M : -if (ePHYType ==PHY_TYPE_11A ) {/* 5GHZ */ +if (bb_type ==BB_TYPE_11A ) {/* 5GHZ */ *pbyTxRate =0x9A ; *pbyRsvTime =32 ; }else {
@@ -139,7 +139,7 @@ s_vCalculateOFDMRParameter(break ;case RATE_18M : -if (ePHYType ==PHY_TYPE_11A ) {/* 5GHZ */ +if (bb_type ==BB_TYPE_11A ) {/* 5GHZ */ *pbyTxRate =0x9E ; *pbyRsvTime =28 ; }else {
@@ -149,7 +149,7 @@ s_vCalculateOFDMRParameter(break ;case RATE_36M : -if (ePHYType ==PHY_TYPE_11A ) {/* 5GHZ */ +if (bb_type ==BB_TYPE_11A ) {/* 5GHZ */ *pbyTxRate =0x9D ; *pbyRsvTime =24 ; }else {
@@ -159,7 +159,7 @@ s_vCalculateOFDMRParameter(break ;case RATE_48M : -if (ePHYType ==PHY_TYPE_11A ) {/* 5GHZ */ +if (bb_type ==BB_TYPE_11A ) {/* 5GHZ */ *pbyTxRate =0x98 ; *pbyRsvTime =24 ; }else {
@@ -169,7 +169,7 @@ s_vCalculateOFDMRParameter(break ;case RATE_54M : -if (ePHYType ==PHY_TYPE_11A ) {/* 5GHZ */ +if (bb_type ==BB_TYPE_11A ) {/* 5GHZ */ *pbyTxRate =0x9C ; *pbyRsvTime =24 ; }else {
@@ -180,7 +180,7 @@ s_vCalculateOFDMRParameter(case RATE_24M :default : -if (ePHYType ==PHY_TYPE_11A ) {/* 5GHZ */ +if (bb_type ==BB_TYPE_11A ) {/* 5GHZ */ *pbyTxRate =0x99 ; *pbyRsvTime =28 ; }else {
Signature · 1 line
2.1.0
PATCH 6/10 staging: vt6655: dead code remove typedef enum _CARD_PHY_TYPE
In reply to Malcolm PriestleyRemoving unused eCurrentPHYType
--- drivers/staging/vt6655/card.h | 7 ------- drivers/staging/vt6655/device.h | 1 - 2 files changed, 8 deletions(-)
drivers/staging/vt6655/card.h +0 -7
@@ -51,13 +51,6 @@#define CB_MAX_CHANNEL_5G 42#define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G) -typedef enum _CARD_PHY_TYPE { -PHY_TYPE_11A =0 , -PHY_TYPE_11B , -PHY_TYPE_11G , -PHY_TYPE_AUTO -}CARD_PHY_TYPE , *PCARD_PHY_TYPE ; - typedef enum _CARD_PKT_TYPE { PKT_TYPE_802_11_BCN, PKT_TYPE_802_11_MNG,
drivers/staging/vt6655/device.h +0 -1
@@ -320,7 +320,6 @@ struct vnt_private {unsigned char byEIFS;unsigned char bySlot;unsigned char byCWMaxMin; -CARD_PHY_TYPE eCurrentPHYType;VIA_BB_TYPE byBBType;/* 0:11A, 1:11B, 2:11G */ VIA_PKT_TYPE byPacketType;/*
Signature · 1 line
2.1.0
PATCH 7/10 staging: vt6655: CARDbSetPhyParameter remove unused parameters
In reply to Malcolm PriestleywCapInfo
byERPField,
*pvSupportRateIEs
*pvExtSupportRateIEs
--- drivers/staging/vt6655/card.c | 4 +--- drivers/staging/vt6655/card.h | 4 +--- drivers/staging/vt6655/device_main.c | 5 ++--- 3 files changed, 4 insertions(+), 9 deletions(-)
drivers/staging/vt6655/card.c +1 -3
@@ -204,9 +204,7 @@ s_vCalculateOFDMRParameter(* * Return Value: None. */ -bool CARDbSetPhyParameter (struct vnt_private *pDevice,u8 bb_type, -unsigned short wCapInfo,unsigned char byERPField, -void *pvSupportRateIEs,void *pvExtSupportRateIEs) +bool CARDbSetPhyParameter (struct vnt_private *pDevice,u8 bb_type) {unsigned char byCWMaxMin =0 ;unsigned char bySlot =0 ;
drivers/staging/vt6655/card.h +1 -3
@@ -82,9 +82,7 @@ void CARDvSafeResetTx(struct vnt_private *);void CARDvSafeResetRx (struct vnt_private *);bool CARDbRadioPowerOff (struct vnt_private *);bool CARDbRadioPowerOn (struct vnt_private *); -bool CARDbSetPhyParameter (struct vnt_private *,u8 , -unsigned short wCapInfo,unsigned char byERPField, -void *pvSupportRateIEs,void *pvExtSupportRateIEs); +bool CARDbSetPhyParameter (struct vnt_private *,u8 );bool CARDbUpdateTSF (struct vnt_private *,unsigned char byRxRate,u64 qwBSSTimestamp,u64 qwLocalTSF);bool CARDbSetBeaconPeriod (struct vnt_private *,unsigned short wBeaconInterval);
drivers/staging/vt6655/device_main.c +2 -3
@@ -1425,8 +1425,7 @@ static int vnt_config(struct ieee80211_hw *hw, u32 changed)if (priv->byBBType != bb_type) { priv->byBBType = bb_type; -CARDbSetPhyParameter (priv, - priv->byBBType,0 ,0 ,NULL ,NULL ); +CARDbSetPhyParameter (priv, priv->byBBType); } }
@@ -1487,7 +1486,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, priv->bShortSlotTime = false;vUpdateIFS (priv); -CARDbSetPhyParameter (priv, priv->byBBType,0 ,0 ,NULL ,NULL ); +CARDbSetPhyParameter (priv, priv->byBBType);BBvSetVGAGainOffset (priv, priv->abyBBVGA[0 ]); }
Signature · 1 line
2.1.0
PATCH 8/10 staging: vt6655: replace typedef enum _VIA_BB_TYPE with macros
In reply to Malcolm PriestleyReplacing type with u8
--- drivers/staging/vt6655/device.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/staging/vt6655/device.h +4 -7
@@ -148,12 +148,9 @@#define NUM 64/* 0:11A 1:11B 2:11G */ -typedef enum _VIA_BB_TYPE -{ -BB_TYPE_11A =0 , -BB_TYPE_11B , -BB_TYPE_11G -}VIA_BB_TYPE , *PVIA_BB_TYPE ; +#define BB_TYPE_11A 0 +#define BB_TYPE_11B 1 +#define BB_TYPE_11G 2/* 0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate) */ typedef enum _VIA_PKT_TYPE
@@ -321,7 +318,7 @@ struct vnt_private {unsigned char bySlot;unsigned char byCWMaxMin; -VIA_BB_TYPE byBBType;/* 0:11A, 1:11B, 2:11G */ +u8 byBBType;/* 0:11A, 1:11B, 2:11G */ VIA_PKT_TYPE byPacketType;/* * 0:11a,1:11b,2:11gb (only CCK * in BasicRate), 3:11ga (OFDM in
Signature · 1 line
2.1.0
PATCH 9/10 staging: vt6655: change typedef enum _VIA_PKT_TYPE to macro
In reply to Malcolm PriestleyReplacing for u8 type and removing cast for byBBType.
--- drivers/staging/vt6655/device.h | 23 ++++++++++------------- drivers/staging/vt6655/device_main.c | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-)
drivers/staging/vt6655/device.h +10 -13
@@ -152,14 +152,11 @@#define BB_TYPE_11B 1#define BB_TYPE_11G 2 -/* 0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate) */ -typedef enum _VIA_PKT_TYPE -{ -PK_TYPE_11A =0 , -PK_TYPE_11B , -PK_TYPE_11GB , -PK_TYPE_11GA -}VIA_PKT_TYPE , *PVIA_PKT_TYPE ; +/* 0:11a, 1:11b, 2:11gb (only CCK in BasicRate), 3:11ga (OFDM in BasicRate) */ +#define PK_TYPE_11A 0 +#define PK_TYPE_11B 1 +#define PK_TYPE_11GB 2 +#define PK_TYPE_11GA 3 typedef struct __chip_info_tbl { CHIP_TYPE chip_id;
@@ -319,11 +316,11 @@ struct vnt_private {unsigned char byCWMaxMin;u8 byBBType;/* 0:11A, 1:11B, 2:11G */ -VIA_PKT_TYPE byPacketType;/* -* 0:11a,1:11b,2:11gb (only CCK -* in BasicRate), 3:11ga (OFDM in -* Basic Rate) -*/ +u8 byPacketType;/* +* 0:11a,1:11b,2:11gb (only CCK +* in BasicRate), 3:11ga (OFDM in +* Basic Rate) +*/ unsigned short wBasicRate;unsigned char byACKRate;unsigned char byTopOFDMBasicRate;
drivers/staging/vt6655/device_main.c +1 -1
@@ -226,7 +226,7 @@ device_set_options(struct vnt_private *pDevice) pDevice->byLongRetryLimit = pDevice->sOpts.long_retry; pDevice->bDiversityRegCtlON = (pDevice->sOpts.flags & DEVICE_FLAGS_DiversityANT) ?1 :0 ; pDevice->byBBType = pDevice->sOpts.bbp_type; - pDevice->byPacketType = (VIA_PKT_TYPE )pDevice->byBBType; + pDevice->byPacketType = pDevice->byBBType; pDevice->byAutoFBCtrl =AUTO_FB_0 ; pDevice->bUpdateBBVGA = true; pDevice->byPreambleType =0 ;
Signature · 1 line
2.1.0
PATCH 10/10 staging: vt6655: always keep abyCurrentNetAddr aligned to 2
In reply to Malcolm PriestleyBecause the driver now uses ether_addr_copy the alignment of this variable must be maintained at 2.
--- drivers/staging/vt6655/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6655/device.h +1 -1
@@ -283,7 +283,7 @@ struct vnt_private {bool bZoneRegExist;unsigned char byOriginalZonetype; -unsigned char abyCurrentNetAddr[ETH_ALEN ]; +unsigned char abyCurrentNetAddr[ETH_ALEN ];__aligned(2) bool bLinkPass;/* link status: OK or fail */ /* Adapter statistics */
Signature · 1 line
2.1.0