[PATCH 3/4] staging: vt6655: replace typedef struct tagDEVICE_RD_INFO
with struct vnt_rd_info volatile is removed because it will generate a warning (in any case this member is not) and renaming rd_info. Signed-off-by: Malcolm Priestley tvbox...@gmail.com --- drivers/staging/vt6655/desc.h| 6 +++--- drivers/staging/vt6655/device.h | 4 ++-- drivers/staging/vt6655/device_main.c | 24 drivers/staging/vt6655/dpc.c | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h index eb0c7c3..752c546 100644 --- a/drivers/staging/vt6655/desc.h +++ b/drivers/staging/vt6655/desc.h @@ -167,10 +167,10 @@ * leads error. */ -typedef struct tagDEVICE_RD_INFO { +struct vnt_rd_info { struct sk_buff *skb; dma_addr_t skb_dma; -} DEVICE_RD_INFO, *PDEVICE_RD_INFO; +}; struct vnt_rdes0 { volatile __le16 res_count; @@ -201,7 +201,7 @@ typedef struct tagSRxDesc { volatile __le32 buff_addr; volatile __le32 next_desc; struct tagSRxDesc *next __aligned(8); - volatile PDEVICE_RD_INFO pRDInfo __aligned(8); + struct vnt_rd_info *rd_info __aligned(8); } __attribute__ ((__packed__)) SRxDesc, *PSRxDesc; typedef const SRxDesc *PCSRxDesc; diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h index c9fa6ef..80cc170 100644 --- a/drivers/staging/vt6655/device.h +++ b/drivers/staging/vt6655/device.h @@ -410,9 +410,9 @@ struct vnt_private { struct ieee80211_low_level_stats low_stats; }; -static inline PDEVICE_RD_INFO alloc_rd_info(void) +static inline struct vnt_rd_info *alloc_rd_info(void) { - return kzalloc(sizeof(DEVICE_RD_INFO), GFP_ATOMIC); + return kzalloc(sizeof(struct vnt_rd_info), GFP_ATOMIC); } static inline struct vnt_td_info *alloc_td_info(void) diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 22c1957..defdcc0 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -622,7 +622,7 @@ static void device_init_rd0_ring(struct vnt_private *pDevice) /* Init the RD0 ring entries */ for (i = 0; i pDevice-sOpts.nRxDescs0; i ++, curr += sizeof(SRxDesc)) { pDesc = (pDevice-aRD0Ring[i]); - pDesc-pRDInfo = alloc_rd_info(); + pDesc-rd_info = alloc_rd_info(); if (!device_alloc_rx_buf(pDevice, pDesc)) dev_err(pDevice-pcid-dev, can not alloc rx bufs\n); @@ -645,7 +645,7 @@ static void device_init_rd1_ring(struct vnt_private *pDevice) /* Init the RD1 ring entries */ for (i = 0; i pDevice-sOpts.nRxDescs1; i ++, curr += sizeof(SRxDesc)) { pDesc = (pDevice-aRD1Ring[i]); - pDesc-pRDInfo = alloc_rd_info(); + pDesc-rd_info = alloc_rd_info(); if (!device_alloc_rx_buf(pDevice, pDesc)) dev_err(pDevice-pcid-dev, can not alloc rx bufs\n); @@ -665,14 +665,14 @@ static void device_free_rd0_ring(struct vnt_private *pDevice) for (i = 0; i pDevice-sOpts.nRxDescs0; i++) { PSRxDescpDesc = (pDevice-aRD0Ring[i]); - PDEVICE_RD_INFO pRDInfo = pDesc-pRDInfo; + struct vnt_rd_info *rd_info = pDesc-rd_info; - dma_unmap_single(pDevice-pcid-dev, pRDInfo-skb_dma, + dma_unmap_single(pDevice-pcid-dev, rd_info-skb_dma, pDevice-rx_buf_sz, DMA_FROM_DEVICE); - dev_kfree_skb(pRDInfo-skb); + dev_kfree_skb(rd_info-skb); - kfree(pDesc-pRDInfo); + kfree(pDesc-rd_info); } } @@ -682,14 +682,14 @@ static void device_free_rd1_ring(struct vnt_private *pDevice) for (i = 0; i pDevice-sOpts.nRxDescs1; i++) { PSRxDescpDesc = (pDevice-aRD1Ring[i]); - PDEVICE_RD_INFO pRDInfo = pDesc-pRDInfo; + struct vnt_rd_info *rd_info = pDesc-rd_info; - dma_unmap_single(pDevice-pcid-dev, pRDInfo-skb_dma, + dma_unmap_single(pDevice-pcid-dev, rd_info-skb_dma, pDevice-rx_buf_sz, DMA_FROM_DEVICE); - dev_kfree_skb(pRDInfo-skb); + dev_kfree_skb(rd_info-skb); - kfree(pDesc-pRDInfo); + kfree(pDesc-rd_info); } } @@ -783,7 +783,7 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx) if (works++ 15) break; - if (!pRD-pRDInfo-skb) + if (!pRD-rd_info-skb) break; if (vnt_receive_frame(pDevice, pRD)) { @@ -803,7 +803,7 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx) static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pRD) { - PDEVICE_RD_INFO pRDInfo = pRD-pRDInfo; + struct
[PATCH 2/3] staging: wilc1000: code style: fix globals initialized to false
Globals should not be initialized to 0 or NULL. Signed-off-by: Raphaël Beamonte raphael.beamo...@gmail.com --- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/wilc_wlan.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index bab5319..53c4ca9 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -536,7 +536,7 @@ typedef enum { tstrWILC_WFIDrv *terminated_handle; tstrWILC_WFIDrv *gWFiDrvHandle; #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP -bool g_obtainingIP = false; +bool g_obtainingIP; #endif u8 P2P_LISTEN_STATE; static struct task_struct *HostIFthreadHandler; @@ -558,7 +558,7 @@ static u8 gapu8RcvdSurveyResults[2][MAX_SURVEY_RESULT_FRAG_SIZE]; static u8 gapu8RcvdAssocResp[MAX_ASSOC_RESP_FRAME_SIZE]; -bool gbScanWhileConnected = false; +bool gbScanWhileConnected; static s8 gs8Rssi; static s8 gs8lnkspd; diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index fac16db..4c40955 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -482,7 +482,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(void) #endif #ifdef TCP_ENHANCEMENTS -bool EnableTCPAckFilter = false; +bool EnableTCPAckFilter; void Enable_TCP_ACK_Filter(bool value) { -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements
Macros with multiple statements should be enclosed in a do - while loop Signed-off-by: Raphaël Beamonte raphael.beamo...@gmail.com --- drivers/staging/wilc1000/wilc_exported_buf.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c index 5294578..45c2c7e 100644 --- a/drivers/staging/wilc1000/wilc_exported_buf.c +++ b/drivers/staging/wilc1000/wilc_exported_buf.c @@ -12,11 +12,13 @@ void *exported_ ## name = NULL; #define MALLOC_WILC_BUFFER(name, size) \ - exported_ ## name = kmalloc(size, GFP_KERNEL);\ - if (!exported_ ## name) { \ - printk(fail to alloc: %s memory\n, exported_ ## name); \ - return -ENOBUFS;\ - } + do { \ + exported_ ## name = kmalloc(size, GFP_KERNEL);\ + if (!exported_ ## name) { \ + printk(fail to alloc: %s memory\n, exported_ ## name); \ + return -ENOBUFS;\ + } + } while (0) #define FREE_WILC_BUFFER(name) \ kfree(exported_ ## name); @@ -73,4 +75,4 @@ MODULE_LICENSE(Dual BSD/GPL); MODULE_AUTHOR(Tony Cho); MODULE_DESCRIPTION(WILC1xxx Memory Manager); pure_initcall(wilc_module_init); -module_exit(wilc_module_deinit); \ No newline at end of file +module_exit(wilc_module_deinit); -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/4] staging: vt6655: replace typedef struct tagSRxDesc
with struct vnt_rx_desc and all members the same. volatile is removed from pointers as this generates warning message. Only the first four members of vnt_rx_desc need to be volatile. Signed-off-by: Malcolm Priestley tvbox...@gmail.com --- drivers/staging/vt6655/card.c| 2 +- drivers/staging/vt6655/desc.h| 8 +++--- drivers/staging/vt6655/device.h | 6 ++--- drivers/staging/vt6655/device_main.c | 51 +++- drivers/staging/vt6655/dpc.c | 2 +- drivers/staging/vt6655/dpc.h | 2 +- 6 files changed, 36 insertions(+), 35 deletions(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index 7a30ba2..ecbe94f 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -564,7 +564,7 @@ CARDvSafeResetRx( ) { unsigned int uu; - PSRxDescpDesc; + struct vnt_rx_desc *pDesc; /* initialize RD index */ pDevice-pCurrRD[0] = (pDevice-aRD0Ring[0]); diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h index 752c546..9fbc717 100644 --- a/drivers/staging/vt6655/desc.h +++ b/drivers/staging/vt6655/desc.h @@ -195,16 +195,14 @@ struct vnt_rdes1 { } __packed; /* Rx descriptor*/ -typedef struct tagSRxDesc { +struct vnt_rx_desc { volatile struct vnt_rdes0 rd0; volatile struct vnt_rdes1 rd1; volatile __le32 buff_addr; volatile __le32 next_desc; - struct tagSRxDesc *next __aligned(8); + struct vnt_rx_desc *next __aligned(8); struct vnt_rd_info *rd_info __aligned(8); -} __attribute__ ((__packed__)) -SRxDesc, *PSRxDesc; -typedef const SRxDesc *PCSRxDesc; +} __packed; struct vnt_tdes0 { volatile u8 tsr0; diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h index 80cc170..d1917d0 100644 --- a/drivers/staging/vt6655/device.h +++ b/drivers/staging/vt6655/device.h @@ -258,9 +258,9 @@ struct vnt_private { struct vnt_tx_desc *apTD0Rings; struct vnt_tx_desc *apTD1Rings; - volatile PSRxDesc aRD0Ring; - volatile PSRxDesc aRD1Ring; - volatile PSRxDesc pCurrRD[TYPE_MAXRD]; + struct vnt_rx_desc *aRD0Ring; + struct vnt_rx_desc *aRD1Ring; + struct vnt_rx_desc *pCurrRD[TYPE_MAXRD]; OPTIONS sOpts; diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index defdcc0..86c24a1 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -155,7 +155,7 @@ static void device_init_td1_ring(struct vnt_private *pDevice); static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx); static int device_tx_srv(struct vnt_private *pDevice, unsigned int uIdx); -static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pDesc); +static bool device_alloc_rx_buf(struct vnt_private *, struct vnt_rx_desc *); static void device_init_registers(struct vnt_private *pDevice); static void device_free_tx_buf(struct vnt_private *, struct vnt_tx_desc *); static void device_free_td0_ring(struct vnt_private *pDevice); @@ -520,8 +520,8 @@ static bool device_init_rings(struct vnt_private *pDevice) /*allocate all RD/TD rings a single pool*/ vir_pool = dma_zalloc_coherent(pDevice-pcid-dev, -pDevice-sOpts.nRxDescs0 * sizeof(SRxDesc) + -pDevice-sOpts.nRxDescs1 * sizeof(SRxDesc) + +pDevice-sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) + +pDevice-sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) + pDevice-sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) + pDevice-sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc), pDevice-pool_dma, GFP_ATOMIC); @@ -532,11 +532,11 @@ static bool device_init_rings(struct vnt_private *pDevice) pDevice-aRD0Ring = vir_pool; pDevice-aRD1Ring = vir_pool + - pDevice-sOpts.nRxDescs0 * sizeof(SRxDesc); + pDevice-sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc); pDevice-rd0_pool_dma = pDevice-pool_dma; pDevice-rd1_pool_dma = pDevice-rd0_pool_dma + - pDevice-sOpts.nRxDescs0 * sizeof(SRxDesc); + pDevice-sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc); pDevice-tx0_bufs = dma_zalloc_coherent(pDevice-pcid-dev, pDevice-sOpts.nTxDescs[0] * PKT_BUF_SZ + @@ -549,8 +549,8 @@ static bool device_init_rings(struct vnt_private *pDevice) dev_err(pDevice-pcid-dev, allocate buf dma memory failed\n); dma_free_coherent(pDevice-pcid-dev, - pDevice-sOpts.nRxDescs0 * sizeof(SRxDesc) + -
[PATCH 1/4] staging: vt6655: replace typedef struct tagRDES0
with struct vnt_rdes0 replacing members as follows wResCount - res_count f15Reserved - f15_reserved f1Owner - owner big endian f8Reserved1 - f8_reserved1 f7Reserved - f7_reserved Narrowing endian differences to inside structure. Signed-off-by: Malcolm Priestley tvbox...@gmail.com --- drivers/staging/vt6655/card.c| 8 drivers/staging/vt6655/desc.h| 33 - drivers/staging/vt6655/device_main.c | 10 +- drivers/staging/vt6655/dpc.c | 2 +- 4 files changed, 22 insertions(+), 31 deletions(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index c7b75df..ab632e0 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -573,16 +573,16 @@ CARDvSafeResetRx( /* init state, all RD is chip's */ for (uu = 0; uu pDevice-sOpts.nRxDescs0; uu++) { pDesc = (pDevice-aRD0Ring[uu]); - pDesc-m_rd0RD0.wResCount = cpu_to_le16(pDevice-rx_buf_sz); - pDesc-m_rd0RD0.f1Owner = OWNED_BY_NIC; + pDesc-rd0.res_count = cpu_to_le16(pDevice-rx_buf_sz); + pDesc-rd0.owner = OWNED_BY_NIC; pDesc-m_rd1RD1.wReqCount = cpu_to_le16(pDevice-rx_buf_sz); } /* init state, all RD is chip's */ for (uu = 0; uu pDevice-sOpts.nRxDescs1; uu++) { pDesc = (pDevice-aRD1Ring[uu]); - pDesc-m_rd0RD0.wResCount = cpu_to_le16(pDevice-rx_buf_sz); - pDesc-m_rd0RD0.f1Owner = OWNED_BY_NIC; + pDesc-rd0.res_count = cpu_to_le16(pDevice-rx_buf_sz); + pDesc-rd0.owner = OWNED_BY_NIC; pDesc-m_rd1RD1.wReqCount = cpu_to_le16(pDevice-rx_buf_sz); } diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h index 3c9007e..68b3121 100644 --- a/drivers/staging/vt6655/desc.h +++ b/drivers/staging/vt6655/desc.h @@ -172,31 +172,22 @@ typedef struct tagDEVICE_RD_INFO { dma_addr_t skb_dma; } DEVICE_RD_INFO, *PDEVICE_RD_INFO; +struct vnt_rdes0 { + volatile __le16 res_count; #ifdef __BIG_ENDIAN - -typedef struct tagRDES0 { - volatile __le16 wResCount; union { - volatile u16f15Reserved; + volatile u16 f15_reserved; struct { - volatile u8 f8Reserved1; - volatile u8 f1Owner:1; - volatile u8 f7Reserved:7; - } __attribute__ ((__packed__)); - } __attribute__ ((__packed__)); -} __attribute__ ((__packed__)) -SRDES0, *PSRDES0; - + volatile u8 f8_reserved1; + volatile u8 owner:1; + volatile u8 f7_reserved:7; + } __packed; + } __packed; #else - -typedef struct tagRDES0 { - __le16 wResCount; - unsigned short f15Reserved:15; - unsigned short f1Owner:1; -} __attribute__ ((__packed__)) -SRDES0; - + u16 f15_reserved:15; + u16 owner:1; #endif +} __packed; typedef struct tagRDES1 { __le16 wReqCount; @@ -206,7 +197,7 @@ SRDES1; /* Rx descriptor*/ typedef struct tagSRxDesc { - volatile SRDES0 m_rd0RD0; + volatile struct vnt_rdes0 rd0; volatile SRDES1 m_rd1RD1; volatile __le32 buff_addr; volatile __le32 next_desc; diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 0d8f123..37c2be2 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -778,7 +778,7 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx) int works = 0; for (pRD = pDevice-pCurrRD[uIdx]; -pRD-m_rd0RD0.f1Owner == OWNED_BY_HOST; +pRD-rd0.owner == OWNED_BY_HOST; pRD = pRD-next) { if (works++ 15) break; @@ -793,7 +793,7 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx) break; } } - pRD-m_rd0RD0.f1Owner = OWNED_BY_NIC; + pRD-rd0.owner = OWNED_BY_NIC; } pDevice-pCurrRD[uIdx] = pRD; @@ -814,10 +814,10 @@ static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pRD) skb_put(pRDInfo-skb, skb_tailroom(pRDInfo-skb)), pDevice-rx_buf_sz, DMA_FROM_DEVICE); - *((unsigned int *)(pRD-m_rd0RD0)) = 0; /* FIX cast */ + *((unsigned int *)pRD-rd0) = 0; /* FIX cast */ - pRD-m_rd0RD0.wResCount = cpu_to_le16(pDevice-rx_buf_sz); - pRD-m_rd0RD0.f1Owner = OWNED_BY_NIC; + pRD-rd0.res_count = cpu_to_le16(pDevice-rx_buf_sz); + pRD-rd0.owner = OWNED_BY_NIC; pRD-m_rd1RD1.wReqCount = cpu_to_le16(pDevice-rx_buf_sz); pRD-buff_addr = cpu_to_le32(pRDInfo-skb_dma); diff --git
[PATCH 2/4] staging: vt6655: replace typedef struct tagRDES1
with struct vnt_rdes1 and members wReqCount - req_count wReserved - reserved Signed-off-by: Malcolm Priestley tvbox...@gmail.com --- drivers/staging/vt6655/card.c| 4 ++-- drivers/staging/vt6655/desc.h| 11 +-- drivers/staging/vt6655/device_main.c | 2 +- drivers/staging/vt6655/dpc.c | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index ab632e0..7a30ba2 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -575,7 +575,7 @@ CARDvSafeResetRx( pDesc = (pDevice-aRD0Ring[uu]); pDesc-rd0.res_count = cpu_to_le16(pDevice-rx_buf_sz); pDesc-rd0.owner = OWNED_BY_NIC; - pDesc-m_rd1RD1.wReqCount = cpu_to_le16(pDevice-rx_buf_sz); + pDesc-rd1.req_count = cpu_to_le16(pDevice-rx_buf_sz); } /* init state, all RD is chip's */ @@ -583,7 +583,7 @@ CARDvSafeResetRx( pDesc = (pDevice-aRD1Ring[uu]); pDesc-rd0.res_count = cpu_to_le16(pDevice-rx_buf_sz); pDesc-rd0.owner = OWNED_BY_NIC; - pDesc-m_rd1RD1.wReqCount = cpu_to_le16(pDevice-rx_buf_sz); + pDesc-rd1.req_count = cpu_to_le16(pDevice-rx_buf_sz); } /* set perPkt mode */ diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h index 68b3121..eb0c7c3 100644 --- a/drivers/staging/vt6655/desc.h +++ b/drivers/staging/vt6655/desc.h @@ -189,16 +189,15 @@ struct vnt_rdes0 { #endif } __packed; -typedef struct tagRDES1 { - __le16 wReqCount; - unsigned short wReserved; -} __attribute__ ((__packed__)) -SRDES1; +struct vnt_rdes1 { + __le16 req_count; + u16 reserved; +} __packed; /* Rx descriptor*/ typedef struct tagSRxDesc { volatile struct vnt_rdes0 rd0; - volatile SRDES1 m_rd1RD1; + volatile struct vnt_rdes1 rd1; volatile __le32 buff_addr; volatile __le32 next_desc; struct tagSRxDesc *next __aligned(8); diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 37c2be2..22c1957 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -818,7 +818,7 @@ static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pRD) pRD-rd0.res_count = cpu_to_le16(pDevice-rx_buf_sz); pRD-rd0.owner = OWNED_BY_NIC; - pRD-m_rd1RD1.wReqCount = cpu_to_le16(pDevice-rx_buf_sz); + pRD-rd1.req_count = cpu_to_le16(pDevice-rx_buf_sz); pRD-buff_addr = cpu_to_le32(pRDInfo-skb_dma); return true; diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c index dbaaeeb..ef39cbe 100644 --- a/drivers/staging/vt6655/dpc.c +++ b/drivers/staging/vt6655/dpc.c @@ -143,7 +143,7 @@ bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd) dma_unmap_single(priv-pcid-dev, rd_info-skb_dma, priv-rx_buf_sz, DMA_FROM_DEVICE); - frame_size = le16_to_cpu(curr_rd-m_rd1RD1.wReqCount) + frame_size = le16_to_cpu(curr_rd-rd1.req_count) - le16_to_cpu(curr_rd-rd0.res_count); if ((frame_size 2364) || (frame_size 33)) { -- 2.5.0 -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] rtlwifi: rtl8192ee: fix semicolon.cocci warnings
On 08/15/2015 05:36 AM, kbuild test robot wrote: drivers/net/wireless/rtlwifi/rtl8192ee/phy.c:856:2-3: Unneeded semicolon drivers/net/wireless/rtlwifi/rtl8192ee/phy.c:492:3-4: Unneeded semicolon drivers/net/wireless/rtlwifi/rtl8192ee/phy.c:452:3-4: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Larry Finger larry.fin...@lwfinger.net Signed-off-by: Fengguang Wu fengguang...@intel.com Signed-off-by: Larry Finger larry.fin...@lwfinger.net Larry --- phy.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/wireless/rtlwifi/rtl8192ee/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ee/phy.c @@ -449,7 +449,7 @@ static void _rtl92ee_phy_set_txpower_by_ Invalid RateSection %d in 2.4G,Rf %d,%dTx\n, rate_section, path, txnum); break; - }; + } } else { RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, Invalid Band %d\n, band); @@ -489,7 +489,7 @@ static u8 _rtl92ee_phy_get_txpower_by_ra Invalid RateSection %d in 2.4G,Rf %d,%dTx\n, rate_section, path, txnum); break; - }; + } } else { RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, Invalid Band %d()\n, band); @@ -853,7 +853,7 @@ static u8 _rtl92ee_get_rate_section_inde else if (regaddr = 0xE20 regaddr = 0xE4C) index = (u8)((regaddr - 0xE20) / 4); break; - }; + } return index; } -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: pull-request: mac80211-next 2015-08-14
Hi Kalle, On Fri, Aug 14, 2015 at 6:54 PM, Johannes Berg johan...@sipsolutions.net wrote: Hi, And, in addition to the fix before, I have a -next pull request. It's actually quite big since I hadn't wanted to send one just before my vacation. Let me know if there are any issues. johannes I will need these patches in iwlwifi-next for my next pull request. Please pull them into your tree when you can (probably after Dave pulls them). Thank you. -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 9/9] mac80211: remove direct probe step before authentication
From: Johannes Berg johannes.b...@intel.com The direct probe step before authentication was done mostly for two reasons: 1) the BSS data could be stale 2) the beacon might not have included all IEs The concern (1) doesn't really seem to be relevant any more as we time out BSS information after about 30 seconds, and in fact the original patch only did the direct probe if the data was older than the BSS timeout to begin with. This condition got (likely inadvertedly) removed later though. Analysing this in more detail shows that since we mostly use data from the association response, the only real reason for needing the probe response was that the code validates the WMM parameters, and those are optional in beacons. As the previous patches removed that behaviour, we can now remove the direct probe step entirely. Signed-off-by: Johannes Berg johannes.b...@intel.com --- net/mac80211/mlme.c | 82 +++-- 1 file changed, 23 insertions(+), 59 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index cd7e55e..1d13ef5 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3262,16 +3262,6 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata, if (ifmgd-associated ether_addr_equal(mgmt-bssid, ifmgd-associated-bssid)) ieee80211_reset_ap_probe(sdata); - - if (ifmgd-auth_data !ifmgd-auth_data-bss-proberesp_ies - ether_addr_equal(mgmt-bssid, ifmgd-auth_data-bss-bssid)) { - /* got probe response, continue with auth */ - sdata_info(sdata, direct probe responded\n); - ifmgd-auth_data-tries = 0; - ifmgd-auth_data-timeout = jiffies; - ifmgd-auth_data-timeout_started = true; - run_again(sdata, ifmgd-auth_data-timeout); - } } /* @@ -3717,12 +3707,14 @@ static void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata, reason); } -static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata) +static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) { struct ieee80211_local *local = sdata-local; struct ieee80211_if_managed *ifmgd = sdata-u.mgd; struct ieee80211_mgd_auth_data *auth_data = ifmgd-auth_data; u32 tx_flags = 0; + u16 trans = 1; + u16 status = 0; sdata_assert_lock(sdata); @@ -3746,54 +3738,27 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata) drv_mgd_prepare_tx(local, sdata); - if (auth_data-bss-proberesp_ies) { - u16 trans = 1; - u16 status = 0; - - sdata_info(sdata, send auth to %pM (try %d/%d)\n, - auth_data-bss-bssid, auth_data-tries, - IEEE80211_AUTH_MAX_TRIES); - - auth_data-expected_transaction = 2; + sdata_info(sdata, send auth to %pM (try %d/%d)\n, + auth_data-bss-bssid, auth_data-tries, + IEEE80211_AUTH_MAX_TRIES); - if (auth_data-algorithm == WLAN_AUTH_SAE) { - trans = auth_data-sae_trans; - status = auth_data-sae_status; - auth_data-expected_transaction = trans; - } + auth_data-expected_transaction = 2; - if (ieee80211_hw_check(local-hw, REPORTS_TX_ACK_STATUS)) - tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | - IEEE80211_TX_INTFL_MLME_CONN_TX; - - ieee80211_send_auth(sdata, trans, auth_data-algorithm, status, - auth_data-data, auth_data-data_len, - auth_data-bss-bssid, - auth_data-bss-bssid, NULL, 0, 0, - tx_flags); - } else { - const u8 *ssidie; + if (auth_data-algorithm == WLAN_AUTH_SAE) { + trans = auth_data-sae_trans; + status = auth_data-sae_status; + auth_data-expected_transaction = trans; + } - sdata_info(sdata, direct probe to %pM (try %d/%i)\n, - auth_data-bss-bssid, auth_data-tries, - IEEE80211_AUTH_MAX_TRIES); + if (ieee80211_hw_check(local-hw, REPORTS_TX_ACK_STATUS)) + tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | + IEEE80211_TX_INTFL_MLME_CONN_TX; - rcu_read_lock(); - ssidie = ieee80211_bss_get_ie(auth_data-bss, WLAN_EID_SSID); - if (!ssidie) { - rcu_read_unlock(); - return -EINVAL; - } - /* -* Direct probe is sent to broadcast address as some APs -* will not answer to direct packet in unassociated state.
[PATCH 5/9] mac80211: Introduce per vif frame registration API
From: Andrei Otcheretianski andrei.otcheretian...@intel.com Currently the cfg80211's frame registration api receives wdev, however mac80211 assumes per device filter configuration and ignores wdev. Per device filtering is too wasteful, especially for multi-channel devices. Introduce new per vif frame registration API and use it for probe request registrations in ieee80211_mgmt_frame_register() Also call directly to ieee80211_configure_filter instead of using a work since it is now allowed to sleep in ieee80211_mgmt_frame_register. Signed-off-by: Andrei Otcheretianski andrei.otcheretian...@intel.com Signed-off-by: Emmanuel Grumbach emmanuel.grumb...@intel.com --- include/net/mac80211.h| 16 net/mac80211/cfg.c| 22 ++ net/mac80211/driver-ops.h | 16 net/mac80211/trace.h | 30 ++ 4 files changed, 80 insertions(+), 4 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index e3314e5..16786450 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -5,6 +5,7 @@ * Copyright 2006-2007 Jiri Benc jb...@suse.cz * Copyright 2007-2010 Johannes Berg johan...@sipsolutions.net * Copyright 2013-2014 Intel Mobile Communications GmbH + * Copyright (C) 2015 Intel Deutschland GmbH * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -1358,6 +1359,8 @@ enum ieee80211_vif_flags { * @debugfs_dir: debugfs dentry, can be used by drivers to create own per * interface debug files. Note that it will be NULL for the virtual * monitor interface (if that is requested.) + * @probe_req_reg: probe requests should be reported to mac80211 for this + * interface. * @drv_priv: data area for driver use, will always be aligned to * sizeof(void *). * @txq: the multicast data TX queue (if driver uses the TXQ abstraction) @@ -1382,6 +1385,8 @@ struct ieee80211_vif { struct dentry *debugfs_dir; #endif + unsigned int probe_req_reg; + /* must be last */ u8 drv_priv[0] __aligned(sizeof(void *)); }; @@ -2825,6 +2830,13 @@ enum ieee80211_reconfig_type { * See the section Frame filtering for more information. * This callback must be implemented and can sleep. * + * @config_iface_filter: Configure the interface's RX filter. + * This callback is optional and is used to configure which frames + * should be passed to mac80211. The filter_flags is the combination + * of FIF_* flags. The changed_flags is a bit mask that indicates + * which flags are changed. + * This callback can sleep. + * * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit * must be set or cleared for a given STA. Must be atomic. * @@ -3264,6 +3276,10 @@ struct ieee80211_ops { unsigned int changed_flags, unsigned int *total_flags, u64 multicast); + void (*config_iface_filter)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + unsigned int filter_flags, + unsigned int changed_flags); int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set); int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 1ca972e..9eab783 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3516,18 +3516,32 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy, u16 frame_type, bool reg) { struct ieee80211_local *local = wiphy_priv(wiphy); + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); switch (frame_type) { case IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ: - if (reg) + if (reg) { local-probe_req_reg++; - else - local-probe_req_reg--; + sdata-vif.probe_req_reg++; + } else { + if (local-probe_req_reg) + local-probe_req_reg--; + + if (sdata-vif.probe_req_reg) + sdata-vif.probe_req_reg--; + } if (!local-open_count) break; - ieee80211_queue_work(local-hw, local-reconfig_filter); + if (sdata-vif.probe_req_reg == 1) + drv_config_iface_filter(local, sdata, FIF_PROBE_REQ, + FIF_PROBE_REQ); + else if (sdata-vif.probe_req_reg == 0) + drv_config_iface_filter(local, sdata, 0, +
[PATCH 8/9] mac80211: avoid VHT usage with no 80MHz chans allowed
From: Arik Nemtsov a...@wizery.com Currently if 80MHz channels are not allowed for use, the VHT IE is not included in the probe request for an AP. This is not good enough if the AP is configured with the wrong regulatory and supports VHT even where prohibited or in TDLS scenarios. Mark the ifmgd with the DISABLE_VHT flag for the misbehaving-AP case, and unset VHT support from the peer-station entry for the TDLS case. Signed-off-by: Arik Nemtsov arikx.nemt...@intel.com Signed-off-by: Emmanuel Grumbach emmanuel.grumb...@intel.com --- net/mac80211/mlme.c | 16 net/mac80211/vht.c | 15 +++ 2 files changed, 31 insertions(+) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 705ef1d..cd7e55e 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4267,6 +4267,8 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, struct ieee80211_supported_band *sband; struct cfg80211_chan_def chandef; int ret; + u32 i; + bool have_80mhz; sband = local-hw.wiphy-bands[cbss-channel-band]; @@ -4317,6 +4319,20 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, } } + /* Allow VHT if at least one channel on the sband supports 80 MHz */ + have_80mhz = false; + for (i = 0; i sband-n_channels; i++) { + if (sband-channels[i].flags (IEEE80211_CHAN_DISABLED | + IEEE80211_CHAN_NO_80MHZ)) + continue; + + have_80mhz = true; + break; + } + + if (!have_80mhz) + ifmgd-flags |= IEEE80211_STA_DISABLE_VHT; + ifmgd-flags |= ieee80211_determine_chantype(sdata, sband, cbss-channel, ht_cap, ht_oper, vht_oper, diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c index 834ccdb..ff1c798 100644 --- a/net/mac80211/vht.c +++ b/net/mac80211/vht.c @@ -120,6 +120,7 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, struct ieee80211_sta_vht_cap *vht_cap = sta-sta.vht_cap; struct ieee80211_sta_vht_cap own_cap; u32 cap_info, i; + bool have_80mhz; memset(vht_cap, 0, sizeof(*vht_cap)); @@ -129,6 +130,20 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, if (!vht_cap_ie || !sband-vht_cap.vht_supported) return; + /* Allow VHT if at least one channel on the sband supports 80 MHz */ + have_80mhz = false; + for (i = 0; i sband-n_channels; i++) { + if (sband-channels[i].flags (IEEE80211_CHAN_DISABLED | + IEEE80211_CHAN_NO_80MHZ)) + continue; + + have_80mhz = true; + break; + } + + if (!have_80mhz) + return; + /* * A VHT STA must support 40 MHz, but if we verify that here * then we break a few things - some APs (e.g. Netgear R6300v2 -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/9] nl80211: support vendor dumpit commands
From: Johannes Berg johannes.b...@intel.com In order to transfer many items in vendor commands, support the dumpit netlink method for them. Signed-off-by: Johannes Berg johannes.b...@intel.com Signed-off-by: Emmanuel Grumbach emmanuel.grumb...@intel.com --- include/net/cfg80211.h | 9 +++ net/wireless/nl80211.c | 192 + 2 files changed, 201 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index f0889a2..0f54c9e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -2971,12 +2971,21 @@ enum wiphy_vendor_command_flags { * @doit: callback for the operation, note that wdev is %NULL if the * flags didn't ask for a wdev and non-%NULL otherwise; the data * pointer may be %NULL if userspace provided no data at all + * @dumpit: dump callback, for transferring bigger/multiple items. The + * @storage points to cb-args[5], ie. is preserved over the multiple + * dumpit calls. + * It's recommended to not have the same sub command with both @doit and + * @dumpit, so that userspace can assume certain ones are get and others + * are used with dump requests. */ struct wiphy_vendor_command { struct nl80211_vendor_cmd_info info; u32 flags; int (*doit)(struct wiphy *wiphy, struct wireless_dev *wdev, const void *data, int data_len); + int (*dumpit)(struct wiphy *wiphy, struct wireless_dev *wdev, + struct sk_buff *skb, const void *data, int data_len, + unsigned long *storage); }; /** diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 5d8748b..19d240b 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3,6 +3,7 @@ * * Copyright 2006-2010 Johannes Berg johan...@sipsolutions.net * Copyright 2013-2014 Intel Mobile Communications GmbH + * Copyright 2015 Intel Deutschland GmbH */ #include linux/if.h @@ -9938,6 +9939,9 @@ static int nl80211_vendor_cmd(struct sk_buff *skb, struct genl_info *info) if (!wdev-netdev !wdev-p2p_started) return -ENETDOWN; } + + if (!vcmd-doit) + return -EOPNOTSUPP; } else { wdev = NULL; } @@ -9957,6 +9961,193 @@ static int nl80211_vendor_cmd(struct sk_buff *skb, struct genl_info *info) return -EOPNOTSUPP; } +static int nl80211_prepare_vendor_dump(struct sk_buff *skb, + struct netlink_callback *cb, + struct cfg80211_registered_device **rdev, + struct wireless_dev **wdev) +{ + u32 vid, subcmd; + unsigned int i; + int vcmd_idx = -1; + int err; + void *data = NULL; + unsigned int data_len = 0; + + rtnl_lock(); + + if (cb-args[0]) { + /* subtract the 1 again here */ + struct wiphy *wiphy = wiphy_idx_to_wiphy(cb-args[0] - 1); + struct wireless_dev *tmp; + + if (!wiphy) { + err = -ENODEV; + goto out_unlock; + } + *rdev = wiphy_to_rdev(wiphy); + *wdev = NULL; + + if (cb-args[1]) { + list_for_each_entry(tmp, (*rdev)-wdev_list, list) { + if (tmp-identifier == cb-args[1] - 1) { + *wdev = tmp; + break; + } + } + } + + /* keep rtnl locked in successful case */ + return 0; + } + + err = nlmsg_parse(cb-nlh, GENL_HDRLEN + nl80211_fam.hdrsize, + nl80211_fam.attrbuf, nl80211_fam.maxattr, + nl80211_policy); + if (err) + goto out_unlock; + + if (!nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_ID] || + !nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) { + err = -EINVAL; + goto out_unlock; + } + + *wdev = __cfg80211_wdev_from_attrs(sock_net(skb-sk), + nl80211_fam.attrbuf); + if (IS_ERR(*wdev)) + *wdev = NULL; + + *rdev = __cfg80211_rdev_from_attrs(sock_net(skb-sk), + nl80211_fam.attrbuf); + if (IS_ERR(*rdev)) { + err = PTR_ERR(*rdev); + goto out_unlock; + } + + vid = nla_get_u32(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_ID]); + subcmd = nla_get_u32(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_SUBCMD]); + + for (i = 0; i (*rdev)-wiphy.n_vendor_commands; i++) { + const struct wiphy_vendor_command *vcmd; + + vcmd =
[PATCH 6/9] mac80211: allow the driver to advertise A-MSDU within A-MPDU Rx support
Drivers may be interested in receiving A-MSDU within A-MDPU. Not all the devices may be able to do so, make it configurable. Signed-off-by: Emmanuel Grumbach emmanuel.grumb...@intel.com --- include/net/mac80211.h | 7 +++ net/mac80211/agg-rx.c | 4 +++- net/mac80211/debugfs.c | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 16786450..344424c 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1897,6 +1897,12 @@ struct ieee80211_txq { * @IEEE80211_HW_TDLS_WIDER_BW: The device/driver supports wider bandwidth * than then BSS bandwidth for a TDLS link on the base channel. * + * @IEEE80211_HW_SUPPORTS_AMSDU_IN_AMPDU: + * Hardware supports A-MSDU within A-MPDU. + * + * @IEEE80211_HW_SUPPORTS_AMSDU_IN_AMPDU: + * Hardware supports A-MSDU within A-MPDU. + * * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags { @@ -1930,6 +1936,7 @@ enum ieee80211_hw_flags { IEEE80211_HW_SUPPORTS_CLONED_SKBS, IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS, IEEE80211_HW_TDLS_WIDER_BW, + IEEE80211_HW_SUPPORTS_AMSDU_IN_AMPDU, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index 5c564a6..78de79b 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c @@ -189,6 +189,7 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *d struct ieee80211_local *local = sdata-local; struct sk_buff *skb; struct ieee80211_mgmt *mgmt; + bool amsdu = ieee80211_hw_check(local-hw, SUPPORTS_AMSDU_IN_AMPDU); u16 capab; skb = dev_alloc_skb(sizeof(*mgmt) + local-hw.extra_tx_headroom); @@ -217,7 +218,8 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *d mgmt-u.action.u.addba_resp.action_code = WLAN_ACTION_ADDBA_RESP; mgmt-u.action.u.addba_resp.dialog_token = dialog_token; - capab = (u16)(policy 1); /* bit 1 aggregation policy */ + capab = (u16)(amsdu 0); /* bit 0 A-MSDU support */ + capab |= (u16)(policy 1);/* bit 1 aggregation policy */ capab |= (u16)(tid 2); /* bit 5:2 TID number */ capab |= (u16)(buf_size 6); /* bit 15:6 max size of aggregation */ diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index ced6bf3..41726fd 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c @@ -123,6 +123,7 @@ static const char *hw_flag_names[NUM_IEEE80211_HW_FLAGS + 1] = { FLAG(SUPPORTS_CLONED_SKBS), FLAG(SINGLE_SCAN_ON_ALL_BANDS), FLAG(TDLS_WIDER_BW), + FLAG(SUPPORTS_AMSDU_IN_AMPDU), /* keep last for the build bug below */ (void *)0x1 -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 7/9] mac80211: allow to transmit A-MSDU within A-MPDU
Advertise the capability to send A-MSDU within A-MPDU in the AddBA request sent by mac80211. Let the driver know about the peer's capabilities. Signed-off-by: Emmanuel Grumbach emmanuel.grumb...@intel.com --- drivers/net/wireless/iwlwifi/dvm/mac80211.c | 2 +- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 2 +- drivers/net/wireless/mac80211_hwsim.c | 2 +- include/linux/ieee80211.h | 1 + include/net/mac80211.h | 5 - net/mac80211/agg-rx.c | 4 ++-- net/mac80211/agg-tx.c | 15 ++- net/mac80211/driver-ops.h | 7 --- net/mac80211/sta_info.h | 2 ++ net/mac80211/trace.h| 10 ++ 10 files changed, 32 insertions(+), 18 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c index 7acaa26..26445a5 100644 --- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c @@ -719,7 +719,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, enum ieee80211_ampdu_mlme_action action, struct ieee80211_sta *sta, u16 tid, u16 *ssn, - u8 buf_size) + u8 buf_size, bool amsdu) { struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); int ret = -EINVAL; diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index dfdab38..dc46919 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c @@ -815,7 +815,7 @@ static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, enum ieee80211_ampdu_mlme_action action, struct ieee80211_sta *sta, u16 tid, - u16 *ssn, u8 buf_size) + u16 *ssn, u8 buf_size, bool amsdu) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index dbb46ec..6d2a622 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -1819,7 +1819,7 @@ static int mac80211_hwsim_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, enum ieee80211_ampdu_mlme_action action, struct ieee80211_sta *sta, u16 tid, u16 *ssn, - u8 buf_size) + u8 buf_size, bool amsdu) { switch (action) { case IEEE80211_AMPDU_TX_START: diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index cfa906f..19eb9ec 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -1379,6 +1379,7 @@ struct ieee80211_ht_operation { /* block-ack parameters */ +#define IEEE80211_ADDBA_PARAM_AMSDU_MASK 0x0001 #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 #define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C #define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0 diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 344424c..d37d6cd 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3033,6 +3033,9 @@ enum ieee80211_reconfig_type { * buffer size of 8. Correct ways to retransmit #1 would be: * - TX: 1 or 18 or 81 * Even 189 would be wrong since 1 could be lost again. + * The @amsdu parameter is valid when the action is set to + * %IEEE80211_AMPDU_TX_OPERATIONAL and indicates the peer's ability + * to receive A-MSDU within A-MPDU. * * Returns a negative error code on failure. * The callback can sleep. @@ -3370,7 +3373,7 @@ struct ieee80211_ops { struct ieee80211_vif *vif, enum ieee80211_ampdu_mlme_action action, struct ieee80211_sta *sta, u16 tid, u16 *ssn, - u8 buf_size); + u8 buf_size, bool amsdu); int (*get_survey)(struct ieee80211_hw *hw, int idx, struct survey_info *survey); void (*rfkill_poll)(struct ieee80211_hw *hw); diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index 78de79b..10ad4ac 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c @@ -79,7 +79,7 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, (int)reason); if (drv_ampdu_action(local, sta-sdata, IEEE80211_AMPDU_RX_STOP, -sta-sta, tid, NULL, 0)) +sta-sta,
[PATCH 2/9] mac80211: TDLS: add proper HT-oper IE
From: Arik Nemtsov a...@wizery.com When 11n peers performs a TDLS connection on a legacy BSS, the HT operation IE must be specified according to IEEE802.11-2012 section 9.23.3.2. Otherwise HT-protection is compromised and the medium becomes noisy for both the TDLS and the BSS links. Signed-off-by: Arik Nemtsov arikx.nemt...@intel.com Reviewed-by: Johannes Berg johannes.b...@intel.com Signed-off-by: Emmanuel Grumbach emmanuel.grumb...@intel.com --- net/mac80211/ibss.c| 2 +- net/mac80211/ieee80211_i.h | 2 +- net/mac80211/mesh.c| 3 ++- net/mac80211/tdls.c| 13 ++--- net/mac80211/util.c| 5 - 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 7f72bc9..cd04cec 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -188,7 +188,7 @@ ieee80211_ibss_build_presp(struct ieee80211_sub_if_data *sdata, * keep them at 0 */ pos = ieee80211_ie_build_ht_oper(pos, sband-ht_cap, -chandef, 0); +chandef, 0, false); /* add VHT capability and information IEs */ if (chandef-width != NL80211_CHAN_WIDTH_20 diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 65f4faa..1f5dba6 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1967,7 +1967,7 @@ u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, u16 cap); u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, const struct cfg80211_chan_def *chandef, - u16 prot_mode); + u16 prot_mode, bool rifs_mode); u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap, u32 cap); u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap, diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index e06a5ca..cc9c0a2 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -462,7 +462,8 @@ int mesh_add_ht_oper_ie(struct ieee80211_sub_if_data *sdata, pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_operation)); ieee80211_ie_build_ht_oper(pos, ht_cap, sdata-vif.bss_conf.chandef, - sdata-vif.bss_conf.ht_operation_mode); + sdata-vif.bss_conf.ht_operation_mode, + false); return 0; } diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 1bacea7..b45cf99 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -591,12 +591,19 @@ ieee80211_tdls_add_setup_cfm_ies(struct ieee80211_sub_if_data *sdata, offset = noffset; } - /* if HT support is only added in TDLS, we need an HT-operation IE */ + /* +* if HT support is only added in TDLS, we need an HT-operation IE. +* add the IE as required by IEEE802.11-2012 9.23.3.2. +*/ if (!ap_sta-sta.ht_cap.ht_supported sta-sta.ht_cap.ht_supported) { + u16 prot = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED | + IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT | + IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT; + pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_operation)); - /* send an empty HT operation IE */ ieee80211_ie_build_ht_oper(pos, sta-sta.ht_cap, - sdata-vif.bss_conf.chandef, 0); + sdata-vif.bss_conf.chandef, prot, + true); } ieee80211_tdls_add_link_ie(sdata, skb, peer, initiator); diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 1104421..8e47a79 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -2272,7 +2272,7 @@ u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap, u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, const struct cfg80211_chan_def *chandef, - u16 prot_mode) + u16 prot_mode, bool rifs_mode) { struct ieee80211_ht_operation *ht_oper; /* Build HT Information */ @@ -2300,6 +2300,9 @@ u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, chandef-width != NL80211_CHAN_WIDTH_20) ht_oper-ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY; + if (rifs_mode) + ht_oper-ht_param |= IEEE80211_HT_PARAM_RIFS_MODE; + ht_oper-operation_mode = cpu_to_le16(prot_mode); ht_oper-stbc_param = 0x; -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe
[PATCH 1/9] mac80211: debugfs: add file to disallow TDLS wider-bw
From: Arik Nemtsov a...@wizery.com Sometimes we are interested in testing TDLS performance in a specific width setting. Add the ability to disable the wider-band feature, thereby allowing the TDLS channel width to be controlled by the BSS width. Signed-off-by: Arik Nemtsov arikx.nemt...@intel.com Signed-off-by: Emmanuel Grumbach emmanuel.grumb...@intel.com --- net/mac80211/cfg.c| 1 + net/mac80211/debugfs_netdev.c | 29 + net/mac80211/ieee80211_i.h| 1 + net/mac80211/tdls.c | 4 +++- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 685ec13..1ca972e 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1156,6 +1156,7 @@ static int sta_apply_parameters(struct ieee80211_local *local, set_sta_flag(sta, WLAN_STA_TDLS_CHAN_SWITCH); if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) + !sdata-u.mgd.tdls_wider_bw_prohibited ieee80211_hw_check(local-hw, TDLS_WIDER_BW) params-ext_capab_len = 8 params-ext_capab[7] WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED) diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 1021e87..f1580e9 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c @@ -455,6 +455,34 @@ static ssize_t ieee80211_if_parse_uapsd_max_sp_len( } IEEE80211_IF_FILE_RW(uapsd_max_sp_len); +static ssize_t ieee80211_if_fmt_tdls_wider_bw( + const struct ieee80211_sub_if_data *sdata, char *buf, int buflen) +{ + const struct ieee80211_if_managed *ifmgd = sdata-u.mgd; + bool tdls_wider_bw; + + tdls_wider_bw = ieee80211_hw_check(sdata-local-hw, TDLS_WIDER_BW) + !ifmgd-tdls_wider_bw_prohibited; + + return snprintf(buf, buflen, %d\n, tdls_wider_bw); +} + +static ssize_t ieee80211_if_parse_tdls_wider_bw( + struct ieee80211_sub_if_data *sdata, const char *buf, int buflen) +{ + struct ieee80211_if_managed *ifmgd = sdata-u.mgd; + u8 val; + int ret; + + ret = kstrtou8(buf, 0, val); + if (ret) + return ret; + + ifmgd-tdls_wider_bw_prohibited = !val; + return buflen; +} +IEEE80211_IF_FILE_RW(tdls_wider_bw); + /* AP attributes */ IEEE80211_IF_FILE(num_mcast_sta, u.ap.num_mcast_sta, ATOMIC); IEEE80211_IF_FILE(num_sta_ps, u.ap.ps.num_sta_ps, ATOMIC); @@ -614,6 +642,7 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata) DEBUGFS_ADD_MODE(beacon_loss, 0200); DEBUGFS_ADD_MODE(uapsd_queues, 0600); DEBUGFS_ADD_MODE(uapsd_max_sp_len, 0600); + DEBUGFS_ADD_MODE(tdls_wider_bw, 0600); } static void add_ap_files(struct ieee80211_sub_if_data *sdata) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 6e52659..65f4faa 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -535,6 +535,7 @@ struct ieee80211_if_managed { struct sk_buff *teardown_skb; /* A copy to send through the AP */ spinlock_t teardown_lock; /* To lock changing teardown_skb */ bool tdls_chan_switch_prohibited; + bool tdls_wider_bw_prohibited; /* WMM-AC TSPEC support */ struct ieee80211_sta_tx_tspec tx_tspec[IEEE80211_NUM_ACS]; diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index aee701a..1bacea7 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -41,9 +41,11 @@ static void ieee80211_tdls_add_ext_capab(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) { struct ieee80211_local *local = sdata-local; + struct ieee80211_if_managed *ifmgd = sdata-u.mgd; bool chan_switch = local-hw.wiphy-features NL80211_FEATURE_TDLS_CHANNEL_SWITCH; - bool wider_band = ieee80211_hw_check(local-hw, TDLS_WIDER_BW); + bool wider_band = ieee80211_hw_check(local-hw, TDLS_WIDER_BW) + !ifmgd-tdls_wider_bw_prohibited; enum ieee80211_band band = ieee80211_get_sdata_band(sdata); struct ieee80211_supported_band *sband = local-hw.wiphy-bands[band]; bool vht = sband sband-vht_cap.vht_supported; -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/9] various patches from our internal tree
Hi Johannes, Just came back from my vacation as well. Here are a few patches we have on our internal tree. I started to send the patch from Andrei (on HW scan vs. the iface work) and ended up with a quite a few, so here they are. You've seen all of them internally already. For those out there who would like to see what we have in our internal tree, I've started to push it on a weekly basis to korg: https://git.kernel.org/cgit/linux/kernel/git/iwlwifi/backport-iwlwifi.git/ Note that patches can be rebased, squashed etc... before they are sent to the ML. Andrei Otcheretianski (1): mac80211: Introduce per vif frame registration API Arik Nemtsov (4): mac80211: debugfs: add file to disallow TDLS wider-bw mac80211: TDLS: add proper HT-oper IE mac80211: TDLS: check reg with IR-relax on chandef upgrade mac80211: avoid VHT usage with no 80MHz chans allowed Emmanuel Grumbach (2): mac80211: allow the driver to advertise A-MSDU within A-MPDU Rx support mac80211: allow to transmit A-MSDU within A-MPDU Johannes Berg (2): nl80211: support vendor dumpit commands mac80211: remove direct probe step before authentication drivers/net/wireless/iwlwifi/dvm/mac80211.c | 2 +- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 2 +- drivers/net/wireless/mac80211_hwsim.c | 2 +- include/linux/ieee80211.h | 1 + include/net/cfg80211.h | 9 ++ include/net/mac80211.h | 28 +++- net/mac80211/agg-rx.c | 8 +- net/mac80211/agg-tx.c | 15 ++- net/mac80211/cfg.c | 23 +++- net/mac80211/debugfs.c | 1 + net/mac80211/debugfs_netdev.c | 29 + net/mac80211/driver-ops.h | 23 +++- net/mac80211/ibss.c | 2 +- net/mac80211/ieee80211_i.h | 3 +- net/mac80211/mesh.c | 3 +- net/mac80211/mlme.c | 98 ++ net/mac80211/sta_info.h | 2 + net/mac80211/tdls.c | 21 ++- net/mac80211/trace.h| 40 +- net/mac80211/util.c | 5 +- net/mac80211/vht.c | 15 +++ net/wireless/nl80211.c | 192 22 files changed, 432 insertions(+), 92 deletions(-) -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html