[PATCH 09/11] staging:rtl8192u: Remove unnecessary line continuation - Style
Remove the unnecessary line continuation character to clear checkpatch issue. This is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index f134cd5a9829..1b0f45f1bb84 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -215,8 +215,7 @@ void free_ieee80211(struct net_device *dev) #ifdef CONFIG_IEEE80211_DEBUG u32 ieee80211_debug_level; -static int debug = \ - // IEEE80211_DL_INFO | +static int debug = // IEEE80211_DL_INFO | // IEEE80211_DL_WX | // IEEE80211_DL_SCAN | // IEEE80211_DL_STATE | -- 2.19.0
[PATCH 08/11] staging:rtl8192u: Add missing blank lines - Style
Add missing blank lines after declarations. This clears the resulting checkpatch issue. This is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index c31db21f7e63..f134cd5a9829 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -199,6 +199,7 @@ void free_ieee80211(struct net_device *dev) for (i = 0; i < WEP_KEYS; i++) { struct ieee80211_crypt_data *crypt = ieee->crypt[i]; + if (crypt) { if (crypt->ops) crypt->ops->deinit(crypt->priv); @@ -248,6 +249,7 @@ static ssize_t write_debug_level(struct file *file, const char __user *buffer, { unsigned long val; int err = kstrtoul_from_user(buffer, count, 0, ); + if (err) return err; ieee80211_debug_level = val; -- 2.19.0
[PATCH 02/11] staging:rtl8192u: Removed commented out include - Style
Remove commented out #include directive. Additionally shorted a block comment to clear the checkpatch issue with line length. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 5f8229f2c757..bd64d126ba2b 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -29,10 +29,9 @@ * James P. Ketrenos * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * - ***/ + **/ #include -/* #include */ #include #include #include -- 2.19.0
[PATCH 11/11] staging:rtl8192u: Correct comparison with NULL - Style
Correct code to remote comparison with NULL, this clears the resulting checkpatch issue. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 5dc780119eff..57127d2a462a 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -275,7 +275,7 @@ int __init ieee80211_debug_init(void) ieee80211_debug_level = debug; ieee80211_proc = proc_mkdir(DRV_NAME, init_net.proc_net); - if (ieee80211_proc == NULL) { + if (!ieee80211_proc) { IEEE80211_ERROR("Unable to create " DRV_NAME " proc directory\n"); return -EIO; -- 2.19.0
[PATCH 10/11] staging:rtl8192u: Correct code alignment - Style
Correct the alignment of a function, this clears checkpatch issue. This is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 1b0f45f1bb84..5dc780119eff 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -244,7 +244,7 @@ static int show_debug_level(struct seq_file *m, void *v) } static ssize_t write_debug_level(struct file *file, const char __user *buffer, -size_t count, loff_t *ppos) +size_t count, loff_t *ppos) { unsigned long val; int err = kstrtoul_from_user(buffer, count, 0, ); -- 2.19.0
[PATCH 09/11] staging:rtl8192u: Remove unnecessary line continuation - Style
Remove the unnecessary line continuation character to clear checkpatch issue. This is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index f134cd5a9829..1b0f45f1bb84 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -215,8 +215,7 @@ void free_ieee80211(struct net_device *dev) #ifdef CONFIG_IEEE80211_DEBUG u32 ieee80211_debug_level; -static int debug = \ - // IEEE80211_DL_INFO | +static int debug = // IEEE80211_DL_INFO | // IEEE80211_DL_WX | // IEEE80211_DL_SCAN | // IEEE80211_DL_STATE | -- 2.19.0
[PATCH 08/11] staging:rtl8192u: Add missing blank lines - Style
Add missing blank lines after declarations. This clears the resulting checkpatch issue. This is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index c31db21f7e63..f134cd5a9829 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -199,6 +199,7 @@ void free_ieee80211(struct net_device *dev) for (i = 0; i < WEP_KEYS; i++) { struct ieee80211_crypt_data *crypt = ieee->crypt[i]; + if (crypt) { if (crypt->ops) crypt->ops->deinit(crypt->priv); @@ -248,6 +249,7 @@ static ssize_t write_debug_level(struct file *file, const char __user *buffer, { unsigned long val; int err = kstrtoul_from_user(buffer, count, 0, ); + if (err) return err; ieee80211_debug_level = val; -- 2.19.0
[PATCH 02/11] staging:rtl8192u: Removed commented out include - Style
Remove commented out #include directive. Additionally shorted a block comment to clear the checkpatch issue with line length. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 5f8229f2c757..bd64d126ba2b 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -29,10 +29,9 @@ * James P. Ketrenos * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * - ***/ + **/ #include -/* #include */ #include #include #include -- 2.19.0
[PATCH 11/11] staging:rtl8192u: Correct comparison with NULL - Style
Correct code to remote comparison with NULL, this clears the resulting checkpatch issue. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 5dc780119eff..57127d2a462a 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -275,7 +275,7 @@ int __init ieee80211_debug_init(void) ieee80211_debug_level = debug; ieee80211_proc = proc_mkdir(DRV_NAME, init_net.proc_net); - if (ieee80211_proc == NULL) { + if (!ieee80211_proc) { IEEE80211_ERROR("Unable to create " DRV_NAME " proc directory\n"); return -EIO; -- 2.19.0
[PATCH 10/11] staging:rtl8192u: Correct code alignment - Style
Correct the alignment of a function, this clears checkpatch issue. This is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 1b0f45f1bb84..5dc780119eff 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -244,7 +244,7 @@ static int show_debug_level(struct seq_file *m, void *v) } static ssize_t write_debug_level(struct file *file, const char __user *buffer, -size_t count, loff_t *ppos) +size_t count, loff_t *ppos) { unsigned long val; int err = kstrtoul_from_user(buffer, count, 0, ); -- 2.19.0
[PATCH 04/11] staging:rtl8192u: Remove extra blank lines - Style
Remove the extra blank lines to clear checkpatch issue. This is a simple coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 20348a1f2d32..c52eac0bf6f6 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -94,7 +94,6 @@ static inline void ieee80211_networks_initialize(struct ieee80211_device *ieee) list_add_tail(>networks[i].list, >network_free_list); } - struct net_device *alloc_ieee80211(int sizeof_priv) { struct ieee80211_device *ieee; @@ -121,7 +120,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv) } ieee80211_networks_initialize(ieee); - /* Default fragmentation threshold is maximum payload size */ ieee->fts = DEFAULT_FTS; ieee->scan_age = DEFAULT_MAX_SCAN_AGE; @@ -186,7 +184,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv) return NULL; } - void free_ieee80211(struct net_device *dev) { struct ieee80211_device *ieee = netdev_priv(dev); -- 2.19.0
[PATCH 04/11] staging:rtl8192u: Remove extra blank lines - Style
Remove the extra blank lines to clear checkpatch issue. This is a simple coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 20348a1f2d32..c52eac0bf6f6 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -94,7 +94,6 @@ static inline void ieee80211_networks_initialize(struct ieee80211_device *ieee) list_add_tail(>networks[i].list, >network_free_list); } - struct net_device *alloc_ieee80211(int sizeof_priv) { struct ieee80211_device *ieee; @@ -121,7 +120,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv) } ieee80211_networks_initialize(ieee); - /* Default fragmentation threshold is maximum payload size */ ieee->fts = DEFAULT_FTS; ieee->scan_age = DEFAULT_MAX_SCAN_AGE; @@ -186,7 +184,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv) return NULL; } - void free_ieee80211(struct net_device *dev) { struct ieee80211_device *ieee = netdev_priv(dev); -- 2.19.0
[PATCH 00/11] staging:rtl8192u: Coding Style changes
Just a number of simple coding style changes in the file ieee80211_module.c John Whitmore (11): staging:rtl8192u: Add missing SPDX-License-Identifier - Style staging:rtl8192u: Removed commented out include - Style staging:rtl8192u: Clear error with line ending ( - Style staging:rtl8192u: Remove extra blank lines - Style staging:rtl8192u: Add spaces around + operator - Style staging:rtl8192u: Rewrite test for null - Style staging:rtl8192u: Correct code indentation - Style staging:rtl8192u: Add missing blank lines - Style staging:rtl8192u: Remove unnecessary line continuation - Style staging:rtl8192u: Correct code alignment - Style staging:rtl8192u: Correct comparison with NULL - Style .../rtl8192u/ieee80211/ieee80211_module.c | 32 +-- 1 file changed, 15 insertions(+), 17 deletions(-) -- 2.19.0
[PATCH 01/11] staging:rtl8192u: Add missing SPDX-License-Identifier - Style
Add the missing SPDX-License-Identifier tag to file to clear the checkpatch issue. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 90a097f2cd4e..5f8229f2c757 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /*** * * Copyright(c) 2004 Intel Corporation. All rights reserved. -- 2.19.0
[PATCH 00/11] staging:rtl8192u: Coding Style changes
Just a number of simple coding style changes in the file ieee80211_module.c John Whitmore (11): staging:rtl8192u: Add missing SPDX-License-Identifier - Style staging:rtl8192u: Removed commented out include - Style staging:rtl8192u: Clear error with line ending ( - Style staging:rtl8192u: Remove extra blank lines - Style staging:rtl8192u: Add spaces around + operator - Style staging:rtl8192u: Rewrite test for null - Style staging:rtl8192u: Correct code indentation - Style staging:rtl8192u: Add missing blank lines - Style staging:rtl8192u: Remove unnecessary line continuation - Style staging:rtl8192u: Correct code alignment - Style staging:rtl8192u: Correct comparison with NULL - Style .../rtl8192u/ieee80211/ieee80211_module.c | 32 +-- 1 file changed, 15 insertions(+), 17 deletions(-) -- 2.19.0
[PATCH 01/11] staging:rtl8192u: Add missing SPDX-License-Identifier - Style
Add the missing SPDX-License-Identifier tag to file to clear the checkpatch issue. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 90a097f2cd4e..5f8229f2c757 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /*** * * Copyright(c) 2004 Intel Corporation. All rights reserved. -- 2.19.0
[PATCH 07/11] staging:rtl8192u: Correct code indentation - Style
Rewrite code block to correct the indentation of code. This clears the resulting checkpatch issue. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 9bbacec52e1f..c31db21f7e63 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -167,9 +167,9 @@ struct net_device *alloc_ieee80211(int sizeof_priv) INIT_LIST_HEAD(>ibss_mac_hash[i]); for (i = 0; i < 17; i++) { - ieee->last_rxseq_num[i] = -1; - ieee->last_rxfrag_num[i] = -1; - ieee->last_packet_time[i] = 0; + ieee->last_rxseq_num[i] = -1; + ieee->last_rxfrag_num[i] = -1; + ieee->last_packet_time[i] = 0; } /* These function were added to load crypte module autoly */ -- 2.19.0
[PATCH 03/11] staging:rtl8192u: Clear error with line ending ( - Style
Rewrite function call to clear the checkpatch issue with lines ending with a '(' character. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index bd64d126ba2b..20348a1f2d32 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -64,9 +64,9 @@ static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee) if (ieee->networks) return 0; - ieee->networks = kcalloc( - MAX_NETWORK_COUNT, sizeof(struct ieee80211_network), - GFP_KERNEL); + ieee->networks = kcalloc(MAX_NETWORK_COUNT, +sizeof(struct ieee80211_network), +GFP_KERNEL); if (!ieee->networks) { printk(KERN_WARNING "%s: Out of memory allocating beacons\n", ieee->dev->name); -- 2.19.0
[PATCH 07/11] staging:rtl8192u: Correct code indentation - Style
Rewrite code block to correct the indentation of code. This clears the resulting checkpatch issue. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 9bbacec52e1f..c31db21f7e63 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -167,9 +167,9 @@ struct net_device *alloc_ieee80211(int sizeof_priv) INIT_LIST_HEAD(>ibss_mac_hash[i]); for (i = 0; i < 17; i++) { - ieee->last_rxseq_num[i] = -1; - ieee->last_rxfrag_num[i] = -1; - ieee->last_packet_time[i] = 0; + ieee->last_rxseq_num[i] = -1; + ieee->last_rxfrag_num[i] = -1; + ieee->last_packet_time[i] = 0; } /* These function were added to load crypte module autoly */ -- 2.19.0
[PATCH 03/11] staging:rtl8192u: Clear error with line ending ( - Style
Rewrite function call to clear the checkpatch issue with lines ending with a '(' character. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index bd64d126ba2b..20348a1f2d32 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -64,9 +64,9 @@ static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee) if (ieee->networks) return 0; - ieee->networks = kcalloc( - MAX_NETWORK_COUNT, sizeof(struct ieee80211_network), - GFP_KERNEL); + ieee->networks = kcalloc(MAX_NETWORK_COUNT, +sizeof(struct ieee80211_network), +GFP_KERNEL); if (!ieee->networks) { printk(KERN_WARNING "%s: Out of memory allocating beacons\n", ieee->dev->name); -- 2.19.0
[PATCH 06/11] staging:rtl8192u: Rewrite test for null - Style
Rewrite a test for NULL to comply with the coding style and clear the checkpatch issue. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 0fe65dd8c407..9bbacec52e1f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -155,7 +155,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ieee80211_softmac_init(ieee); ieee->pHTInfo = kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL); - if (ieee->pHTInfo == NULL) { + if (!ieee->pHTInfo) { IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n"); goto failed; } -- 2.19.0
[PATCH 05/11] staging:rtl8192u: Add spaces around + operator - Style
Add spaces around '+' operator to clear the checkpatch issue. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index c52eac0bf6f6..0fe65dd8c407 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -109,7 +109,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) } ieee = netdev_priv(dev); - memset(ieee, 0, sizeof(struct ieee80211_device)+sizeof_priv); + memset(ieee, 0, sizeof(struct ieee80211_device) + sizeof_priv); ieee->dev = dev; err = ieee80211_networks_allocate(ieee); -- 2.19.0
[PATCH 06/11] staging:rtl8192u: Rewrite test for null - Style
Rewrite a test for NULL to comply with the coding style and clear the checkpatch issue. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 0fe65dd8c407..9bbacec52e1f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -155,7 +155,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ieee80211_softmac_init(ieee); ieee->pHTInfo = kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL); - if (ieee->pHTInfo == NULL) { + if (!ieee->pHTInfo) { IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n"); goto failed; } -- 2.19.0
[PATCH 05/11] staging:rtl8192u: Add spaces around + operator - Style
Add spaces around '+' operator to clear the checkpatch issue. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index c52eac0bf6f6..0fe65dd8c407 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -109,7 +109,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) } ieee = netdev_priv(dev); - memset(ieee, 0, sizeof(struct ieee80211_device)+sizeof_priv); + memset(ieee, 0, sizeof(struct ieee80211_device) + sizeof_priv); ieee->dev = dev; err = ieee80211_networks_allocate(ieee); -- 2.19.0
Re: [PATCH 05/13] staging:rtl8192u: Remove AdvCoding and GreenField - Style
On Fri, Sep 28, 2018 at 02:35:50PM +0200, Greg KH wrote: > On Wed, Sep 26, 2018 at 08:16:56PM +0100, John Whitmore wrote: > > The member variables AdvCoding and GreenField are unused in code so > > have been removed from the structure and associated initialisation > > function. > > > > This is a coding style change which should have no impact on runtime > > code execution. > > > > Signed-off-by: John Whitmore > > --- > > drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 -- > > drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 -- > > 2 files changed, 4 deletions(-) > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > index 64d5359cf7e2..83fb8f34ccbd 100644 > > --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > @@ -39,10 +39,8 @@ enum ht_extension_chan_offset { > > > > struct ht_capability_ele { > > //HT capability info > > - u8 AdvCoding:1; > > u8 ChlWidth:1; > > u8 MimoPwrSave:2; > > - u8 GreenField:1; > > Don't these fields come from the hardware itself? By removing them > here, you just changed the memory layout of the structure. Does the > driver still work properly after this? If you can't test it, I can't > take this patch as it's too risky... > Sorry, yes the structure looks like it should come from the hardware but as the structure is allocated from memory I expected to find a memcopy either to or from the hardware. Yes risky, just because I couldn't find it don't mean the connection to hardware ain't there. I'll lay off the risky and who knows if I keep wondering through the driver I'll find that illusive connection.
Re: [PATCH 05/13] staging:rtl8192u: Remove AdvCoding and GreenField - Style
On Fri, Sep 28, 2018 at 02:35:50PM +0200, Greg KH wrote: > On Wed, Sep 26, 2018 at 08:16:56PM +0100, John Whitmore wrote: > > The member variables AdvCoding and GreenField are unused in code so > > have been removed from the structure and associated initialisation > > function. > > > > This is a coding style change which should have no impact on runtime > > code execution. > > > > Signed-off-by: John Whitmore > > --- > > drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 -- > > drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 -- > > 2 files changed, 4 deletions(-) > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > index 64d5359cf7e2..83fb8f34ccbd 100644 > > --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > @@ -39,10 +39,8 @@ enum ht_extension_chan_offset { > > > > struct ht_capability_ele { > > //HT capability info > > - u8 AdvCoding:1; > > u8 ChlWidth:1; > > u8 MimoPwrSave:2; > > - u8 GreenField:1; > > Don't these fields come from the hardware itself? By removing them > here, you just changed the memory layout of the structure. Does the > driver still work properly after this? If you can't test it, I can't > take this patch as it's too risky... > Sorry, yes the structure looks like it should come from the hardware but as the structure is allocated from memory I expected to find a memcopy either to or from the hardware. Yes risky, just because I couldn't find it don't mean the connection to hardware ain't there. I'll lay off the risky and who knows if I keep wondering through the driver I'll find that illusive connection.
Re: [PATCH 05/13] staging:rtl8192u: Remove AdvCoding and GreenField - Style
On Fri, Sep 28, 2018 at 05:31:40PM +0300, Dan Carpenter wrote: > On Wed, Sep 26, 2018 at 08:16:56PM +0100, John Whitmore wrote: > > The member variables AdvCoding and GreenField are unused in code so > > have been removed from the structure and associated initialisation > > function. > > > > This is a coding style change which should have no impact on runtime > > code execution. > > > > Signed-off-by: John Whitmore > > --- > > drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 -- > > drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 -- > > 2 files changed, 4 deletions(-) > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > index 64d5359cf7e2..83fb8f34ccbd 100644 > > --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > @@ -39,10 +39,8 @@ enum ht_extension_chan_offset { > > > > struct ht_capability_ele { > > //HT capability info > > - u8 AdvCoding:1; > > u8 ChlWidth:1; > > u8 MimoPwrSave:2; > > - u8 GreenField:1; > > u8 ShortGI20Mhz:1; > > u8 ShortGI40Mhz:1; > > u8 TxSTBC:1; > > I feel like we discussed this before. I'm pretty sure this comes from > the firmware and so the format can't be changed. When I look at > rtllib_parse_mife_generic() then I think that "info_element" probably > comes from the firmware. > > I wouldn't want to accept this with out someone testing it. > > regards, > dan carpenter > Thank you and sorry about not helping the signal to noise ratio on here. I agree that a bit field like that and it looks like it comes from firmware, but my question or possibly obsession was where. There are structures inside structures, but they are all allocated from RAM. Because of that I expected to find a memcopy from the device, or given that the bitfield is initialised with values that it might be memcopy'd to the device. I just couldn't find that memcopy, but that's down to my untrained eye. I'll stumble across it in some obscure corner of the driver.
Re: [PATCH 05/13] staging:rtl8192u: Remove AdvCoding and GreenField - Style
On Fri, Sep 28, 2018 at 05:31:40PM +0300, Dan Carpenter wrote: > On Wed, Sep 26, 2018 at 08:16:56PM +0100, John Whitmore wrote: > > The member variables AdvCoding and GreenField are unused in code so > > have been removed from the structure and associated initialisation > > function. > > > > This is a coding style change which should have no impact on runtime > > code execution. > > > > Signed-off-by: John Whitmore > > --- > > drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 -- > > drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 -- > > 2 files changed, 4 deletions(-) > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > index 64d5359cf7e2..83fb8f34ccbd 100644 > > --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h > > @@ -39,10 +39,8 @@ enum ht_extension_chan_offset { > > > > struct ht_capability_ele { > > //HT capability info > > - u8 AdvCoding:1; > > u8 ChlWidth:1; > > u8 MimoPwrSave:2; > > - u8 GreenField:1; > > u8 ShortGI20Mhz:1; > > u8 ShortGI40Mhz:1; > > u8 TxSTBC:1; > > I feel like we discussed this before. I'm pretty sure this comes from > the firmware and so the format can't be changed. When I look at > rtllib_parse_mife_generic() then I think that "info_element" probably > comes from the firmware. > > I wouldn't want to accept this with out someone testing it. > > regards, > dan carpenter > Thank you and sorry about not helping the signal to noise ratio on here. I agree that a bit field like that and it looks like it comes from firmware, but my question or possibly obsession was where. There are structures inside structures, but they are all allocated from RAM. Because of that I expected to find a memcopy from the device, or given that the bitfield is initialised with values that it might be memcopy'd to the device. I just couldn't find that memcopy, but that's down to my untrained eye. I'll stumble across it in some obscure corner of the driver.
[PATCH 03/13] staging:rtl8192u: Remove definition of HTSetConnectBwMode - Style
Remove the redundant declaration of the function HTSetConnectBwMode() as it is not needed in the code. The function is already declared in header file, multiple declarations add nothing. This is a style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index ebe8d527a080..977a1e5c9b52 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -837,7 +837,6 @@ static u8 HTFilterMCSRate(struct ieee80211_device *ieee, u8 *pSupportMCS, return true; } -void HTSetConnectBwMode(struct ieee80211_device *ieee, enum ht_channel_width Bandwidth, enum ht_extension_chan_offset Offset); void HTOnAssocRsp(struct ieee80211_device *ieee) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; -- 2.18.0
[PATCH 10/13] staging:rtl8192u: Remove ExtHTCapInfo - Style
The member variable ExtHTCapInfo is not used in code so has been removed. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 3 --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 0c5ded7ad98c..f36fbf56c585 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -54,9 +54,6 @@ struct ht_capability_ele { //Supported MCS set u8 MCS[16]; - //Extended HT Capability Info - u16 ExtHTCapInfo; - //TXBF Capabilities u8 TxBFCap[4]; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 58c94440aab0..e20488ecbd96 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -542,9 +542,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u pCapELE->MCS[i] = 0; } - //Extended HT Capability Info - memset(>ExtHTCapInfo, 0, 2); - //TXBF Capabilities memset(pCapELE->TxBFCap, 0, 4); -- 2.18.0
[PATCH 03/13] staging:rtl8192u: Remove definition of HTSetConnectBwMode - Style
Remove the redundant declaration of the function HTSetConnectBwMode() as it is not needed in the code. The function is already declared in header file, multiple declarations add nothing. This is a style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index ebe8d527a080..977a1e5c9b52 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -837,7 +837,6 @@ static u8 HTFilterMCSRate(struct ieee80211_device *ieee, u8 *pSupportMCS, return true; } -void HTSetConnectBwMode(struct ieee80211_device *ieee, enum ht_channel_width Bandwidth, enum ht_extension_chan_offset Offset); void HTOnAssocRsp(struct ieee80211_device *ieee) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; -- 2.18.0
[PATCH 10/13] staging:rtl8192u: Remove ExtHTCapInfo - Style
The member variable ExtHTCapInfo is not used in code so has been removed. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 3 --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 0c5ded7ad98c..f36fbf56c585 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -54,9 +54,6 @@ struct ht_capability_ele { //Supported MCS set u8 MCS[16]; - //Extended HT Capability Info - u16 ExtHTCapInfo; - //TXBF Capabilities u8 TxBFCap[4]; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 58c94440aab0..e20488ecbd96 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -542,9 +542,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u pCapELE->MCS[i] = 0; } - //Extended HT Capability Info - memset(>ExtHTCapInfo, 0, 2); - //TXBF Capabilities memset(pCapELE->TxBFCap, 0, 4); -- 2.18.0
[PATCH 05/13] staging:rtl8192u: Remove AdvCoding and GreenField - Style
The member variables AdvCoding and GreenField are unused in code so have been removed from the structure and associated initialisation function. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 -- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 64d5359cf7e2..83fb8f34ccbd 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -39,10 +39,8 @@ enum ht_extension_chan_offset { struct ht_capability_ele { //HT capability info - u8 AdvCoding:1; u8 ChlWidth:1; u8 MimoPwrSave:2; - u8 GreenField:1; u8 ShortGI20Mhz:1; u8 ShortGI40Mhz:1; u8 TxSTBC:1; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index c73a8058cf87..d1fbe65ed428 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -493,7 +493,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u } //HT capability info - pCapELE->AdvCoding = 0; // This feature is not supported now!! if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) pCapELE->ChlWidth = 0; else @@ -501,7 +500,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u // pCapELE->ChlWidth = (pHT->bRegBW40MHz?1:0); pCapELE->MimoPwrSave= pHT->SelfMimoPs; - pCapELE->GreenField = 0; // This feature is not supported now!! pCapELE->ShortGI20Mhz = 1; // We can receive Short GI!! pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!! //DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r", -- 2.18.0
[PATCH 05/13] staging:rtl8192u: Remove AdvCoding and GreenField - Style
The member variables AdvCoding and GreenField are unused in code so have been removed from the structure and associated initialisation function. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 -- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 64d5359cf7e2..83fb8f34ccbd 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -39,10 +39,8 @@ enum ht_extension_chan_offset { struct ht_capability_ele { //HT capability info - u8 AdvCoding:1; u8 ChlWidth:1; u8 MimoPwrSave:2; - u8 GreenField:1; u8 ShortGI20Mhz:1; u8 ShortGI40Mhz:1; u8 TxSTBC:1; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index c73a8058cf87..d1fbe65ed428 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -493,7 +493,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u } //HT capability info - pCapELE->AdvCoding = 0; // This feature is not supported now!! if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) pCapELE->ChlWidth = 0; else @@ -501,7 +500,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u // pCapELE->ChlWidth = (pHT->bRegBW40MHz?1:0); pCapELE->MimoPwrSave= pHT->SelfMimoPs; - pCapELE->GreenField = 0; // This feature is not supported now!! pCapELE->ShortGI20Mhz = 1; // We can receive Short GI!! pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!! //DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r", -- 2.18.0
[PATCH 09/13] staging:rtl8192u: Remove Rsvd2 - Style
Remove the unused member variable Rsvd2 from structure. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 4154b4e27e59..0c5ded7ad98c 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -50,7 +50,6 @@ struct ht_capability_ele { //MAC HT parameters info u8 MaxRxAMPDUFactor:2; u8 MPDUDensity:3; - u8 Rsvd2:3; //Supported MCS set u8 MCS[16]; -- 2.18.0
[PATCH 09/13] staging:rtl8192u: Remove Rsvd2 - Style
Remove the unused member variable Rsvd2 from structure. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 4154b4e27e59..0c5ded7ad98c 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -50,7 +50,6 @@ struct ht_capability_ele { //MAC HT parameters info u8 MaxRxAMPDUFactor:2; u8 MPDUDensity:3; - u8 Rsvd2:3; //Supported MCS set u8 MCS[16]; -- 2.18.0
[PATCH 12/13] staging:rtl8192u: Remove ASCap - Style
Remove the unused member variable ASCap from code. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 4 drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 -- 2 files changed, 6 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 204e4a5495a1..85a8716c6b05 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -53,10 +53,6 @@ struct ht_capability_ele { //Supported MCS set u8 MCS[16]; - - //Antenna Selection Capabilities - u8 ASCap; - } __packed; /* diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 9188bd925262..4f6e9da465e2 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -542,8 +542,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u pCapELE->MCS[i] = 0; } - //Antenna Selection Capabilities - pCapELE->ASCap = 0; //add 2 to give space for element ID and len when construct frames if (pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC) *len = 30 + 2; -- 2.18.0
[PATCH 07/13] staging:rtl8192u: Remove DelayBA, PSMP and Rsvd1 - Style
Remove the unused member variables DelayBA, PSMP and Rsvd1. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 3 --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 -- 2 files changed, 5 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 52cce0dcf9a5..09596a7a6814 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -43,11 +43,8 @@ struct ht_capability_ele { u8 MimoPwrSave:2; u8 ShortGI20Mhz:1; u8 ShortGI40Mhz:1; - u8 DelayBA:1; u8 MaxAMSDUSize:1; u8 DssCCk:1; - u8 PSMP:1; - u8 Rsvd1:1; u8 LSigTxopProtect:1; //MAC HT parameters info diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index b4220df1f833..94cedf5f1163 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -503,10 +503,8 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!! //DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r", //pCapELE->ChlWidth, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz); - pCapELE->DelayBA= 0;// Do not support now!! pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0; pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0); - pCapELE->PSMP = 0; // Do not support now!! pCapELE->LSigTxopProtect= 0; // Do not support now!! /* -- 2.18.0
[PATCH 02/13] staging:rtl8192u: Make HTMcsToDataRate static - Style
The function HTMcsToDataRate() is not used outside the file in which it is defined, so has been declared as 'static' and the prototype removed from the header file. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 1 - drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index cc694e567040..8c91cb29fc9d 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -2382,7 +2382,6 @@ u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame); //extern void HTSetConnectBwModeCallback(unsigned long data); void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo); bool IsHTHalfNmodeAPs(struct ieee80211_device *ieee); -u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate); u16 TxCountToDataRate(struct ieee80211_device *ieee, u8 nDataRate); //function in BAPROC.c int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb); diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index ea1261e33a68..ebe8d527a080 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -216,7 +216,7 @@ void HTDebugHTInfo(u8 *InfoIE, u8 *TitleString) pHTInfoEle->BasicMSC[1], pHTInfoEle->BasicMSC[2], pHTInfoEle->BasicMSC[3], pHTInfoEle->BasicMSC[4]); } -u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate) +static u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; -- 2.18.0
[PATCH 12/13] staging:rtl8192u: Remove ASCap - Style
Remove the unused member variable ASCap from code. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 4 drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 -- 2 files changed, 6 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 204e4a5495a1..85a8716c6b05 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -53,10 +53,6 @@ struct ht_capability_ele { //Supported MCS set u8 MCS[16]; - - //Antenna Selection Capabilities - u8 ASCap; - } __packed; /* diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 9188bd925262..4f6e9da465e2 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -542,8 +542,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u pCapELE->MCS[i] = 0; } - //Antenna Selection Capabilities - pCapELE->ASCap = 0; //add 2 to give space for element ID and len when construct frames if (pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC) *len = 30 + 2; -- 2.18.0
[PATCH 07/13] staging:rtl8192u: Remove DelayBA, PSMP and Rsvd1 - Style
Remove the unused member variables DelayBA, PSMP and Rsvd1. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 3 --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 -- 2 files changed, 5 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 52cce0dcf9a5..09596a7a6814 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -43,11 +43,8 @@ struct ht_capability_ele { u8 MimoPwrSave:2; u8 ShortGI20Mhz:1; u8 ShortGI40Mhz:1; - u8 DelayBA:1; u8 MaxAMSDUSize:1; u8 DssCCk:1; - u8 PSMP:1; - u8 Rsvd1:1; u8 LSigTxopProtect:1; //MAC HT parameters info diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index b4220df1f833..94cedf5f1163 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -503,10 +503,8 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!! //DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r", //pCapELE->ChlWidth, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz); - pCapELE->DelayBA= 0;// Do not support now!! pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0; pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0); - pCapELE->PSMP = 0; // Do not support now!! pCapELE->LSigTxopProtect= 0; // Do not support now!! /* -- 2.18.0
[PATCH 02/13] staging:rtl8192u: Make HTMcsToDataRate static - Style
The function HTMcsToDataRate() is not used outside the file in which it is defined, so has been declared as 'static' and the prototype removed from the header file. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 1 - drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index cc694e567040..8c91cb29fc9d 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -2382,7 +2382,6 @@ u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame); //extern void HTSetConnectBwModeCallback(unsigned long data); void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo); bool IsHTHalfNmodeAPs(struct ieee80211_device *ieee); -u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate); u16 TxCountToDataRate(struct ieee80211_device *ieee, u8 nDataRate); //function in BAPROC.c int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb); diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index ea1261e33a68..ebe8d527a080 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -216,7 +216,7 @@ void HTDebugHTInfo(u8 *InfoIE, u8 *TitleString) pHTInfoEle->BasicMSC[1], pHTInfoEle->BasicMSC[2], pHTInfoEle->BasicMSC[3], pHTInfoEle->BasicMSC[4]); } -u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate) +static u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; -- 2.18.0
[PATCH 01/13] staging:rtl8192u: Remove HTHalfMcsToDataRate() - Style
The function HTHalfMcsToDataRate() is unused in code so has simply been removed from the code. As a result two static functions, (IsHTHalfNmode40Bandwidth and IsHTHalfNmodeSGI), are not longer called, so they have been removed as well. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- .../staging/rtl8192u/ieee80211/ieee80211.h| 1 - .../rtl8192u/ieee80211/rtl819x_HTProc.c | 57 --- 2 files changed, 58 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index b4e7ae60ac1c..cc694e567040 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -2382,7 +2382,6 @@ u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame); //extern void HTSetConnectBwModeCallback(unsigned long data); void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo); bool IsHTHalfNmodeAPs(struct ieee80211_device *ieee); -u16 HTHalfMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate); u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate); u16 TxCountToDataRate(struct ieee80211_device *ieee, u8 nDataRate); //function in BAPROC.c diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 9bf52cebe4cd..ea1261e33a68 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -216,63 +216,6 @@ void HTDebugHTInfo(u8 *InfoIE, u8 *TitleString) pHTInfoEle->BasicMSC[1], pHTInfoEle->BasicMSC[2], pHTInfoEle->BasicMSC[3], pHTInfoEle->BasicMSC[4]); } -/* - * Return: true if station in half n mode and AP supports 40 bw - */ -static bool IsHTHalfNmode40Bandwidth(struct ieee80211_device *ieee) -{ - boolretValue = false; - PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; - - if (!pHTInfo->bCurrentHTSupport)// wireless is n mode - retValue = false; - else if (!pHTInfo->bRegBW40MHz) // station supports 40 bw - retValue = false; - else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode - retValue = false; - else if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ChlWidth) // ap support 40 bw - retValue = true; - else - retValue = false; - - return retValue; -} - -static bool IsHTHalfNmodeSGI(struct ieee80211_device *ieee, bool is40MHz) -{ - boolretValue = false; - PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; - - if (!pHTInfo->bCurrentHTSupport)// wireless is n mode - retValue = false; - else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode - retValue = false; - else if (is40MHz) { // ap support 40 bw - if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ShortGI40Mhz) // ap support 40 bw short GI - retValue = true; - else - retValue = false; - } else { - if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ShortGI20Mhz) // ap support 40 bw short GI - retValue = true; - else - retValue = false; - } - - return retValue; -} - -u16 HTHalfMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate) -{ - u8 is40MHz; - u8 isShortGI; - - is40MHz = (IsHTHalfNmode40Bandwidth(ieee)) ? 1 : 0; - isShortGI = (IsHTHalfNmodeSGI(ieee, is40MHz)) ? 1 : 0; - - return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate & 0x7f)]; -} - u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; -- 2.18.0
[PATCH 13/13] staging:rtl8192u: Remove potential memory leak
Add call to ieee80211_networks_free() to avoid potential memory leak if allocation of pHTInfo fails. If the third allocation fails only the first successful allocation is freed, not the second. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 90a097f2cd4e..aada077ced0f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -159,6 +159,11 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ieee->pHTInfo = kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL); if (ieee->pHTInfo == NULL) { IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n"); + + /* By this point in code ieee80211_networks_allocate() has been +* successfully called so the memory allocated should be freed +*/ + ieee80211_networks_free(ieee); goto failed; } HTUpdateDefaultSetting(ieee); -- 2.18.0
[PATCH 01/13] staging:rtl8192u: Remove HTHalfMcsToDataRate() - Style
The function HTHalfMcsToDataRate() is unused in code so has simply been removed from the code. As a result two static functions, (IsHTHalfNmode40Bandwidth and IsHTHalfNmodeSGI), are not longer called, so they have been removed as well. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- .../staging/rtl8192u/ieee80211/ieee80211.h| 1 - .../rtl8192u/ieee80211/rtl819x_HTProc.c | 57 --- 2 files changed, 58 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index b4e7ae60ac1c..cc694e567040 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -2382,7 +2382,6 @@ u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame); //extern void HTSetConnectBwModeCallback(unsigned long data); void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo); bool IsHTHalfNmodeAPs(struct ieee80211_device *ieee); -u16 HTHalfMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate); u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate); u16 TxCountToDataRate(struct ieee80211_device *ieee, u8 nDataRate); //function in BAPROC.c diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 9bf52cebe4cd..ea1261e33a68 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -216,63 +216,6 @@ void HTDebugHTInfo(u8 *InfoIE, u8 *TitleString) pHTInfoEle->BasicMSC[1], pHTInfoEle->BasicMSC[2], pHTInfoEle->BasicMSC[3], pHTInfoEle->BasicMSC[4]); } -/* - * Return: true if station in half n mode and AP supports 40 bw - */ -static bool IsHTHalfNmode40Bandwidth(struct ieee80211_device *ieee) -{ - boolretValue = false; - PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; - - if (!pHTInfo->bCurrentHTSupport)// wireless is n mode - retValue = false; - else if (!pHTInfo->bRegBW40MHz) // station supports 40 bw - retValue = false; - else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode - retValue = false; - else if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ChlWidth) // ap support 40 bw - retValue = true; - else - retValue = false; - - return retValue; -} - -static bool IsHTHalfNmodeSGI(struct ieee80211_device *ieee, bool is40MHz) -{ - boolretValue = false; - PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; - - if (!pHTInfo->bCurrentHTSupport)// wireless is n mode - retValue = false; - else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode - retValue = false; - else if (is40MHz) { // ap support 40 bw - if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ShortGI40Mhz) // ap support 40 bw short GI - retValue = true; - else - retValue = false; - } else { - if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ShortGI20Mhz) // ap support 40 bw short GI - retValue = true; - else - retValue = false; - } - - return retValue; -} - -u16 HTHalfMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate) -{ - u8 is40MHz; - u8 isShortGI; - - is40MHz = (IsHTHalfNmode40Bandwidth(ieee)) ? 1 : 0; - isShortGI = (IsHTHalfNmodeSGI(ieee, is40MHz)) ? 1 : 0; - - return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate & 0x7f)]; -} - u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; -- 2.18.0
[PATCH 13/13] staging:rtl8192u: Remove potential memory leak
Add call to ieee80211_networks_free() to avoid potential memory leak if allocation of pHTInfo fails. If the third allocation fails only the first successful allocation is freed, not the second. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 90a097f2cd4e..aada077ced0f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -159,6 +159,11 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ieee->pHTInfo = kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL); if (ieee->pHTInfo == NULL) { IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n"); + + /* By this point in code ieee80211_networks_allocate() has been +* successfully called so the memory allocated should be freed +*/ + ieee80211_networks_free(ieee); goto failed; } HTUpdateDefaultSetting(ieee); -- 2.18.0
[PATCH 04/13] staging:rtl8192u: Move HTSetConnectBwModeCallback() - Style
The function HTSetConnectBwModeCallback() is only used in the file in which it is defined, so has been changed to being of type 'static'. Additionally the function is defined after it is used so a prototype was included in the file. This prototype, in the middle of the file has been removed and the function implementation moved so that it is defined before it is used in the file. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- .../staging/rtl8192u/ieee80211/ieee80211.h| 1 - .../rtl8192u/ieee80211/rtl819x_HTProc.c | 47 +-- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index 8c91cb29fc9d..8aa536d79900 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -2379,7 +2379,6 @@ u8 HTGetHighestMCSRate(struct ieee80211_device *ieee, extern u8 MCS_FILTER_ALL[]; extern u16 MCS_DATA_RATE[2][2][77]; u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame); -//extern void HTSetConnectBwModeCallback(unsigned long data); void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo); bool IsHTHalfNmodeAPs(struct ieee80211_device *ieee); u16 TxCountToDataRate(struct ieee80211_device *ieee, u8 nDataRate); diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 977a1e5c9b52..c73a8058cf87 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -1011,7 +1011,6 @@ void HTOnAssocRsp(struct ieee80211_device *ieee) pHTInfo->CurrentOpMode = pPeerHTInfo->OptMode; } -void HTSetConnectBwModeCallback(struct ieee80211_device *ieee); /* *function: initialize HT info(struct PRT_HIGH_THROUGHPUT) * input: struct ieee80211_device* ieee @@ -1228,6 +1227,29 @@ u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame) return false; } +static void HTSetConnectBwModeCallback(struct ieee80211_device *ieee) +{ + PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; + + IEEE80211_DEBUG(IEEE80211_DL_HT, "==>%s()\n", __func__); + + if (pHTInfo->bCurBW40MHz) { + if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER) + ieee->set_chan(ieee->dev, ieee->current_network.channel + 2); + else if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_LOWER) + ieee->set_chan(ieee->dev, ieee->current_network.channel - 2); + else + ieee->set_chan(ieee->dev, ieee->current_network.channel); + + ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, pHTInfo->CurSTAExtChnlOffset); + } else { + ieee->set_chan(ieee->dev, ieee->current_network.channel); + ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); + } + + pHTInfo->bSwBwInProgress = false; +} + /* * This function set bandwidth mode in protocol layer. */ @@ -1278,26 +1300,3 @@ void HTSetConnectBwMode(struct ieee80211_device *ieee, enum ht_channel_width Ban // spin_unlock_irqrestore(&(ieee->bw_spinlock), flags); } - -void HTSetConnectBwModeCallback(struct ieee80211_device *ieee) -{ - PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; - - IEEE80211_DEBUG(IEEE80211_DL_HT, "==>%s()\n", __func__); - - if (pHTInfo->bCurBW40MHz) { - if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER) - ieee->set_chan(ieee->dev, ieee->current_network.channel + 2); - else if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_LOWER) - ieee->set_chan(ieee->dev, ieee->current_network.channel - 2); - else - ieee->set_chan(ieee->dev, ieee->current_network.channel); - - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, pHTInfo->CurSTAExtChnlOffset); - } else { - ieee->set_chan(ieee->dev, ieee->current_network.channel); - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); - } - - pHTInfo->bSwBwInProgress = false; -} -- 2.18.0
[PATCH 00/13] staging:rtl8192u: Style & memory leak fix
Back again. I previously went through the struct ht_capability_ele renaming member variables as being unused. At the time I wasn't 100% sure that the structure wasn't memory mapped, or used by external callers to the module, through function pointers or exported symbols. Having had a more detailed look over the code I'm happy that these member variables are not used and have removed them from the code. The last patch is a potential memory leak, which only happens if two memory allocations succeed and the third allocation fails. So it's probably never going to happen, but fixed it anyhow. I've tried to find this device, or a datasheet on it, so that I could actually make sure it still worked but that's not been possible. Apparently it's a discontinued device, but that possibly makes it a safer sandbox to start messing with. John Whitmore (13): staging:rtl8192u: Remove HTHalfMcsToDataRate() - Style staging:rtl8192u: Make HTMcsToDataRate static - Style staging:rtl8192u: Remove definition of HTSetConnectBwMode - Style staging:rtl8192u: Move HTSetConnectBwModeCallback() - Style staging:rtl8192u: Remove AdvCoding and GreenField - Style staging:rtl8192u: Remove TxSTBC and RxSTBC - Style staging:rtl8192u: Remove DelayBA, PSMP and Rsvd1 - Style staging:rtl8192u: Remove LSigTxopProtect - Style staging:rtl8192u: Remove Rsvd2 - Style staging:rtl8192u: Remove ExtHTCapInfo - Style staging:rtl8192u: Remove TxBFCap - Style staging:rtl8192u: Remove ASCap - Style staging:rtl8192u: Remove potential memory leak .../staging/rtl8192u/ieee80211/ieee80211.h| 3 - .../rtl8192u/ieee80211/ieee80211_module.c | 5 + .../staging/rtl8192u/ieee80211/rtl819x_HT.h | 20 +-- .../rtl8192u/ieee80211/rtl819x_HTProc.c | 123 -- 4 files changed, 30 insertions(+), 121 deletions(-) -- 2.18.0
[PATCH 04/13] staging:rtl8192u: Move HTSetConnectBwModeCallback() - Style
The function HTSetConnectBwModeCallback() is only used in the file in which it is defined, so has been changed to being of type 'static'. Additionally the function is defined after it is used so a prototype was included in the file. This prototype, in the middle of the file has been removed and the function implementation moved so that it is defined before it is used in the file. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- .../staging/rtl8192u/ieee80211/ieee80211.h| 1 - .../rtl8192u/ieee80211/rtl819x_HTProc.c | 47 +-- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index 8c91cb29fc9d..8aa536d79900 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -2379,7 +2379,6 @@ u8 HTGetHighestMCSRate(struct ieee80211_device *ieee, extern u8 MCS_FILTER_ALL[]; extern u16 MCS_DATA_RATE[2][2][77]; u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame); -//extern void HTSetConnectBwModeCallback(unsigned long data); void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo); bool IsHTHalfNmodeAPs(struct ieee80211_device *ieee); u16 TxCountToDataRate(struct ieee80211_device *ieee, u8 nDataRate); diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 977a1e5c9b52..c73a8058cf87 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -1011,7 +1011,6 @@ void HTOnAssocRsp(struct ieee80211_device *ieee) pHTInfo->CurrentOpMode = pPeerHTInfo->OptMode; } -void HTSetConnectBwModeCallback(struct ieee80211_device *ieee); /* *function: initialize HT info(struct PRT_HIGH_THROUGHPUT) * input: struct ieee80211_device* ieee @@ -1228,6 +1227,29 @@ u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame) return false; } +static void HTSetConnectBwModeCallback(struct ieee80211_device *ieee) +{ + PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; + + IEEE80211_DEBUG(IEEE80211_DL_HT, "==>%s()\n", __func__); + + if (pHTInfo->bCurBW40MHz) { + if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER) + ieee->set_chan(ieee->dev, ieee->current_network.channel + 2); + else if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_LOWER) + ieee->set_chan(ieee->dev, ieee->current_network.channel - 2); + else + ieee->set_chan(ieee->dev, ieee->current_network.channel); + + ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, pHTInfo->CurSTAExtChnlOffset); + } else { + ieee->set_chan(ieee->dev, ieee->current_network.channel); + ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); + } + + pHTInfo->bSwBwInProgress = false; +} + /* * This function set bandwidth mode in protocol layer. */ @@ -1278,26 +1300,3 @@ void HTSetConnectBwMode(struct ieee80211_device *ieee, enum ht_channel_width Ban // spin_unlock_irqrestore(&(ieee->bw_spinlock), flags); } - -void HTSetConnectBwModeCallback(struct ieee80211_device *ieee) -{ - PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; - - IEEE80211_DEBUG(IEEE80211_DL_HT, "==>%s()\n", __func__); - - if (pHTInfo->bCurBW40MHz) { - if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER) - ieee->set_chan(ieee->dev, ieee->current_network.channel + 2); - else if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_LOWER) - ieee->set_chan(ieee->dev, ieee->current_network.channel - 2); - else - ieee->set_chan(ieee->dev, ieee->current_network.channel); - - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, pHTInfo->CurSTAExtChnlOffset); - } else { - ieee->set_chan(ieee->dev, ieee->current_network.channel); - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); - } - - pHTInfo->bSwBwInProgress = false; -} -- 2.18.0
[PATCH 00/13] staging:rtl8192u: Style & memory leak fix
Back again. I previously went through the struct ht_capability_ele renaming member variables as being unused. At the time I wasn't 100% sure that the structure wasn't memory mapped, or used by external callers to the module, through function pointers or exported symbols. Having had a more detailed look over the code I'm happy that these member variables are not used and have removed them from the code. The last patch is a potential memory leak, which only happens if two memory allocations succeed and the third allocation fails. So it's probably never going to happen, but fixed it anyhow. I've tried to find this device, or a datasheet on it, so that I could actually make sure it still worked but that's not been possible. Apparently it's a discontinued device, but that possibly makes it a safer sandbox to start messing with. John Whitmore (13): staging:rtl8192u: Remove HTHalfMcsToDataRate() - Style staging:rtl8192u: Make HTMcsToDataRate static - Style staging:rtl8192u: Remove definition of HTSetConnectBwMode - Style staging:rtl8192u: Move HTSetConnectBwModeCallback() - Style staging:rtl8192u: Remove AdvCoding and GreenField - Style staging:rtl8192u: Remove TxSTBC and RxSTBC - Style staging:rtl8192u: Remove DelayBA, PSMP and Rsvd1 - Style staging:rtl8192u: Remove LSigTxopProtect - Style staging:rtl8192u: Remove Rsvd2 - Style staging:rtl8192u: Remove ExtHTCapInfo - Style staging:rtl8192u: Remove TxBFCap - Style staging:rtl8192u: Remove ASCap - Style staging:rtl8192u: Remove potential memory leak .../staging/rtl8192u/ieee80211/ieee80211.h| 3 - .../rtl8192u/ieee80211/ieee80211_module.c | 5 + .../staging/rtl8192u/ieee80211/rtl819x_HT.h | 20 +-- .../rtl8192u/ieee80211/rtl819x_HTProc.c | 123 -- 4 files changed, 30 insertions(+), 121 deletions(-) -- 2.18.0
[PATCH 08/13] staging:rtl8192u: Remove LSigTxopProtect - Style
Remove the unused member bit LSigTxopProtect. This member is not used in code so has been replaced with a 'padding' bit, to keep byte boundary alignment. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 09596a7a6814..4154b4e27e59 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -45,7 +45,7 @@ struct ht_capability_ele { u8 ShortGI40Mhz:1; u8 MaxAMSDUSize:1; u8 DssCCk:1; - u8 LSigTxopProtect:1; + u8 padding:1; //MAC HT parameters info u8 MaxRxAMPDUFactor:2; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 94cedf5f1163..58c94440aab0 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -505,7 +505,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u //pCapELE->ChlWidth, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz); pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0; pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0); - pCapELE->LSigTxopProtect= 0; // Do not support now!! /* * MAC HT parameters info -- 2.18.0
[PATCH 11/13] staging:rtl8192u: Remove TxBFCap - Style
The member variable TxBFCap is not used in code so has simply been removed from the code. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 3 --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index f36fbf56c585..204e4a5495a1 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -54,9 +54,6 @@ struct ht_capability_ele { //Supported MCS set u8 MCS[16]; - //TXBF Capabilities - u8 TxBFCap[4]; - //Antenna Selection Capabilities u8 ASCap; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index e20488ecbd96..9188bd925262 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -542,9 +542,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u pCapELE->MCS[i] = 0; } - //TXBF Capabilities - memset(pCapELE->TxBFCap, 0, 4); - //Antenna Selection Capabilities pCapELE->ASCap = 0; //add 2 to give space for element ID and len when construct frames -- 2.18.0
[PATCH 08/13] staging:rtl8192u: Remove LSigTxopProtect - Style
Remove the unused member bit LSigTxopProtect. This member is not used in code so has been replaced with a 'padding' bit, to keep byte boundary alignment. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 09596a7a6814..4154b4e27e59 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -45,7 +45,7 @@ struct ht_capability_ele { u8 ShortGI40Mhz:1; u8 MaxAMSDUSize:1; u8 DssCCk:1; - u8 LSigTxopProtect:1; + u8 padding:1; //MAC HT parameters info u8 MaxRxAMPDUFactor:2; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 94cedf5f1163..58c94440aab0 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -505,7 +505,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u //pCapELE->ChlWidth, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz); pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0; pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0); - pCapELE->LSigTxopProtect= 0; // Do not support now!! /* * MAC HT parameters info -- 2.18.0
[PATCH 11/13] staging:rtl8192u: Remove TxBFCap - Style
The member variable TxBFCap is not used in code so has simply been removed from the code. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 3 --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index f36fbf56c585..204e4a5495a1 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -54,9 +54,6 @@ struct ht_capability_ele { //Supported MCS set u8 MCS[16]; - //TXBF Capabilities - u8 TxBFCap[4]; - //Antenna Selection Capabilities u8 ASCap; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index e20488ecbd96..9188bd925262 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -542,9 +542,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u pCapELE->MCS[i] = 0; } - //TXBF Capabilities - memset(pCapELE->TxBFCap, 0, 4); - //Antenna Selection Capabilities pCapELE->ASCap = 0; //add 2 to give space for element ID and len when construct frames -- 2.18.0
[PATCH 06/13] staging:rtl8192u: Remove TxSTBC and RxSTBC - Style
Remove the member variables TxSTBC and RxSTBC as neither is used in code. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 -- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 3 --- 2 files changed, 5 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 83fb8f34ccbd..52cce0dcf9a5 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -43,8 +43,6 @@ struct ht_capability_ele { u8 MimoPwrSave:2; u8 ShortGI20Mhz:1; u8 ShortGI40Mhz:1; - u8 TxSTBC:1; - u8 RxSTBC:2; u8 DelayBA:1; u8 MaxAMSDUSize:1; u8 DssCCk:1; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index d1fbe65ed428..b4220df1f833 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -145,7 +145,6 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString) IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupported Channel Width = %s\n", (pCapELE->ChlWidth) ? "20MHz" : "20/40MHz"); IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->ShortGI20Mhz) ? "YES" : "NO"); IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->ShortGI40Mhz) ? "YES" : "NO"); - IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport TX STBC = %s\n", (pCapELE->TxSTBC) ? "YES" : "NO"); IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->MaxAMSDUSize) ? "3839" : "7935"); IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->DssCCk) ? "YES" : "NO"); IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->MaxRxAMPDUFactor); @@ -504,8 +503,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!! //DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r", //pCapELE->ChlWidth, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz); - pCapELE->TxSTBC = 1; - pCapELE->RxSTBC = 0; pCapELE->DelayBA= 0;// Do not support now!! pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0; pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0); -- 2.18.0
[PATCH 06/13] staging:rtl8192u: Remove TxSTBC and RxSTBC - Style
Remove the member variables TxSTBC and RxSTBC as neither is used in code. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 -- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 3 --- 2 files changed, 5 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 83fb8f34ccbd..52cce0dcf9a5 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -43,8 +43,6 @@ struct ht_capability_ele { u8 MimoPwrSave:2; u8 ShortGI20Mhz:1; u8 ShortGI40Mhz:1; - u8 TxSTBC:1; - u8 RxSTBC:2; u8 DelayBA:1; u8 MaxAMSDUSize:1; u8 DssCCk:1; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index d1fbe65ed428..b4220df1f833 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -145,7 +145,6 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString) IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupported Channel Width = %s\n", (pCapELE->ChlWidth) ? "20MHz" : "20/40MHz"); IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->ShortGI20Mhz) ? "YES" : "NO"); IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->ShortGI40Mhz) ? "YES" : "NO"); - IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport TX STBC = %s\n", (pCapELE->TxSTBC) ? "YES" : "NO"); IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->MaxAMSDUSize) ? "3839" : "7935"); IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->DssCCk) ? "YES" : "NO"); IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->MaxRxAMPDUFactor); @@ -504,8 +503,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!! //DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r", //pCapELE->ChlWidth, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz); - pCapELE->TxSTBC = 1; - pCapELE->RxSTBC = 0; pCapELE->DelayBA= 0;// Do not support now!! pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0; pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0); -- 2.18.0
Re: [PATCH 20/20] staging:rtl8192u: Rename OWN - Style
On Mon, Sep 10, 2018 at 05:09:27PM +0200, Greg KH wrote: > On Sat, Sep 01, 2018 at 12:02:50AM +0100, John Whitmore wrote: > > Rename the member variable 'OWN' to 'own', this is to comply with the > > coding standard, where variables are named in lowercase. > > > > This is a simple coding style change which should have no impact on > > runtime code execution. > > > > Signed-off-by: John Whitmore > > --- > > drivers/staging/rtl8192u/r8192U.h | 2 +- > > drivers/staging/rtl8192u/r8192U_core.c | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/staging/rtl8192u/r8192U.h > > b/drivers/staging/rtl8192u/r8192U.h > > index 68e82b32a88e..f963b664e221 100644 > > --- a/drivers/staging/rtl8192u/r8192U.h > > +++ b/drivers/staging/rtl8192u/r8192U.h > > @@ -165,7 +165,7 @@ struct tx_desc_819x_usb { > > u8 last_seg:1; > > u8 first_seg:1; > > u8 linip:1; > > - u8 OWN:1; > > + u8 own:1; > > > > /* DWORD 1 */ > > u8 TxFWInfoSize; > > diff --git a/drivers/staging/rtl8192u/r8192U_core.c > > b/drivers/staging/rtl8192u/r8192U_core.c > > index 911d0214b48a..4d0f70ec31ac 100644 > > --- a/drivers/staging/rtl8192u/r8192U_core.c > > +++ b/drivers/staging/rtl8192u/r8192U_core.c > > @@ -1558,7 +1558,7 @@ short rtl8192_tx(struct net_device *dev, struct > > sk_buff *skb) > > /* DWORD 0 */ > > tx_desc->first_seg = 1; > > tx_desc->last_seg = 1; > > - tx_desc->OWN = 1; > > + tx_desc->own = 1; > > Is this another case of a variable being set once and then never used? > > If so, just delete it. > > thanks, > > greg k-h em, I wasn't sure because that variable's a memeber of the sk_buff * passed into the funtion. That function should be static to the file and is only called from function rtl8192_hard_start_xmit() but that's a function pointer which is sort of exported: priv->ieee80211->softmac_hard_start_xmit = rtl8192_hard_start_xmit; Having said that the 'OWN' member is part of the private data: struct tx_desc_819x_usb *tx_desc = (struct tx_desc_819x_usb *)skb->data; Like I say I wasn't sure so played it safe. I guess it's private data so nobody outside the driver should be messing with that data, and I'm not sure how public that function is. I'll read some, ponder a bit and have another go. jwhitmore
Re: [PATCH 20/20] staging:rtl8192u: Rename OWN - Style
On Mon, Sep 10, 2018 at 05:09:27PM +0200, Greg KH wrote: > On Sat, Sep 01, 2018 at 12:02:50AM +0100, John Whitmore wrote: > > Rename the member variable 'OWN' to 'own', this is to comply with the > > coding standard, where variables are named in lowercase. > > > > This is a simple coding style change which should have no impact on > > runtime code execution. > > > > Signed-off-by: John Whitmore > > --- > > drivers/staging/rtl8192u/r8192U.h | 2 +- > > drivers/staging/rtl8192u/r8192U_core.c | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/staging/rtl8192u/r8192U.h > > b/drivers/staging/rtl8192u/r8192U.h > > index 68e82b32a88e..f963b664e221 100644 > > --- a/drivers/staging/rtl8192u/r8192U.h > > +++ b/drivers/staging/rtl8192u/r8192U.h > > @@ -165,7 +165,7 @@ struct tx_desc_819x_usb { > > u8 last_seg:1; > > u8 first_seg:1; > > u8 linip:1; > > - u8 OWN:1; > > + u8 own:1; > > > > /* DWORD 1 */ > > u8 TxFWInfoSize; > > diff --git a/drivers/staging/rtl8192u/r8192U_core.c > > b/drivers/staging/rtl8192u/r8192U_core.c > > index 911d0214b48a..4d0f70ec31ac 100644 > > --- a/drivers/staging/rtl8192u/r8192U_core.c > > +++ b/drivers/staging/rtl8192u/r8192U_core.c > > @@ -1558,7 +1558,7 @@ short rtl8192_tx(struct net_device *dev, struct > > sk_buff *skb) > > /* DWORD 0 */ > > tx_desc->first_seg = 1; > > tx_desc->last_seg = 1; > > - tx_desc->OWN = 1; > > + tx_desc->own = 1; > > Is this another case of a variable being set once and then never used? > > If so, just delete it. > > thanks, > > greg k-h em, I wasn't sure because that variable's a memeber of the sk_buff * passed into the funtion. That function should be static to the file and is only called from function rtl8192_hard_start_xmit() but that's a function pointer which is sort of exported: priv->ieee80211->softmac_hard_start_xmit = rtl8192_hard_start_xmit; Having said that the 'OWN' member is part of the private data: struct tx_desc_819x_usb *tx_desc = (struct tx_desc_819x_usb *)skb->data; Like I say I wasn't sure so played it safe. I guess it's private data so nobody outside the driver should be messing with that data, and I'm not sure how public that function is. I'll read some, ponder a bit and have another go. jwhitmore
Re: [PATCH 1/1] staging:rtl8192u: Rename dot11d_init to fix name clash
On Mon, Sep 10, 2018 at 10:19:29AM +0200, Greg KH wrote: > On Tue, Sep 04, 2018 at 11:56:23AM +0100, John Whitmore wrote: > > The function dot11d_init() was previously renamed to clear a style > > issue. Unfortunately the new name used, dot11d_init(), clashes with > > a sybmol which is exported with the same name. To correct this > > problem the function has been renamed to rtl8192u_dot11d_init(). > > > > Signed-off-by: John Whitmore > > You forgot a "Reported-by:" tag here. I'll go add it... > > thanks, > > greg k-h Sorry and thank you.
Re: [PATCH 1/1] staging:rtl8192u: Rename dot11d_init to fix name clash
On Mon, Sep 10, 2018 at 10:19:29AM +0200, Greg KH wrote: > On Tue, Sep 04, 2018 at 11:56:23AM +0100, John Whitmore wrote: > > The function dot11d_init() was previously renamed to clear a style > > issue. Unfortunately the new name used, dot11d_init(), clashes with > > a sybmol which is exported with the same name. To correct this > > problem the function has been renamed to rtl8192u_dot11d_init(). > > > > Signed-off-by: John Whitmore > > You forgot a "Reported-by:" tag here. I'll go add it... > > thanks, > > greg k-h Sorry and thank you.
[PATCH 3/4] staging:rtl8192u: Remove typedef from firmware_init_step_e - Style
Remove the typedef directive from enumerated type firmware_init_step_e this clears the checkpatch issue with adding new types to the code. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r819xU_firmware.c | 2 +- drivers/staging/rtl8192u/r819xU_firmware.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c index 9c7e19aedff1..15fd026638fe 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.c +++ b/drivers/staging/rtl8192u/r819xU_firmware.c @@ -209,7 +209,7 @@ bool init_firmware(struct net_device *dev) u8 *mapped_file = NULL; u32 init_step = 0; opt_rst_type_e rst_opt = OPT_SYSTEM_RESET; - firmware_init_step_estarting_state = FW_INIT_STEP0_BOOT; + enum firmware_init_step_e starting_state = FW_INIT_STEP0_BOOT; rt_firmware *pfirmware = priv->pFirmware; const struct firmware *fw_entry; diff --git a/drivers/staging/rtl8192u/r819xU_firmware.h b/drivers/staging/rtl8192u/r819xU_firmware.h index e78e547044b4..870301853480 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.h +++ b/drivers/staging/rtl8192u/r819xU_firmware.h @@ -5,11 +5,11 @@ #define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) \ (4 * ((v) / 4) - 8 - USB_HWDESC_HEADER_LEN) -typedef enum _firmware_init_step { +enum firmware_init_step_e { FW_INIT_STEP0_BOOT = 0, FW_INIT_STEP1_MAIN = 1, FW_INIT_STEP2_DATA = 2, -} firmware_init_step_e; +}; typedef enum _opt_rst_type { OPT_SYSTEM_RESET = 0, -- 2.18.0
[PATCH 3/4] staging:rtl8192u: Remove typedef from firmware_init_step_e - Style
Remove the typedef directive from enumerated type firmware_init_step_e this clears the checkpatch issue with adding new types to the code. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r819xU_firmware.c | 2 +- drivers/staging/rtl8192u/r819xU_firmware.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c index 9c7e19aedff1..15fd026638fe 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.c +++ b/drivers/staging/rtl8192u/r819xU_firmware.c @@ -209,7 +209,7 @@ bool init_firmware(struct net_device *dev) u8 *mapped_file = NULL; u32 init_step = 0; opt_rst_type_e rst_opt = OPT_SYSTEM_RESET; - firmware_init_step_estarting_state = FW_INIT_STEP0_BOOT; + enum firmware_init_step_e starting_state = FW_INIT_STEP0_BOOT; rt_firmware *pfirmware = priv->pFirmware; const struct firmware *fw_entry; diff --git a/drivers/staging/rtl8192u/r819xU_firmware.h b/drivers/staging/rtl8192u/r819xU_firmware.h index e78e547044b4..870301853480 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.h +++ b/drivers/staging/rtl8192u/r819xU_firmware.h @@ -5,11 +5,11 @@ #define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) \ (4 * ((v) / 4) - 8 - USB_HWDESC_HEADER_LEN) -typedef enum _firmware_init_step { +enum firmware_init_step_e { FW_INIT_STEP0_BOOT = 0, FW_INIT_STEP1_MAIN = 1, FW_INIT_STEP2_DATA = 2, -} firmware_init_step_e; +}; typedef enum _opt_rst_type { OPT_SYSTEM_RESET = 0, -- 2.18.0
[PATCH 4/4] staging:rtl8192u: Remove typedef from enum opt_rst_type_e - Style
Remove the typedef directive from enumerated type opt_rst_type_e, this change clears the checkpatch issue with defining new types in the code. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r819xU_firmware.c | 2 +- drivers/staging/rtl8192u/r819xU_firmware.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c index 15fd026638fe..c3ea906f3af3 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.c +++ b/drivers/staging/rtl8192u/r819xU_firmware.c @@ -208,7 +208,7 @@ bool init_firmware(struct net_device *dev) u32 file_length = 0; u8 *mapped_file = NULL; u32 init_step = 0; - opt_rst_type_e rst_opt = OPT_SYSTEM_RESET; + enum opt_rst_type_erst_opt = OPT_SYSTEM_RESET; enum firmware_init_step_e starting_state = FW_INIT_STEP0_BOOT; rt_firmware *pfirmware = priv->pFirmware; diff --git a/drivers/staging/rtl8192u/r819xU_firmware.h b/drivers/staging/rtl8192u/r819xU_firmware.h index 870301853480..b84344c1e62b 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.h +++ b/drivers/staging/rtl8192u/r819xU_firmware.h @@ -11,9 +11,9 @@ enum firmware_init_step_e { FW_INIT_STEP2_DATA = 2, }; -typedef enum _opt_rst_type { +enum opt_rst_type_e { OPT_SYSTEM_RESET = 0, OPT_FIRMWARE_RESET = 1, -} opt_rst_type_e; +}; #endif -- 2.18.0
[PATCH 0/4] staging:rtl8192u: Style changes r819xU_firmware.h
This short series of patches just clears simple checkpatch issues with the header file r819xU_firmware.h. John Whitmore (4): staging:rtl8192u: Remove unused RTL8190_CPU_START_OFFSET - Style staging:rtl8192u: Refactor GET_COMMAND_PACKET_FRAG_THRESHOLD - Style staging:rtl8192u: Remove typedef from firmware_init_step_e - Style staging:rtl8192u: Remove typedef from enum opt_rst_type_e - Style drivers/staging/rtl8192u/r819xU_firmware.c | 4 ++-- drivers/staging/rtl8192u/r819xU_firmware.h | 11 +-- 2 files changed, 7 insertions(+), 8 deletions(-) -- 2.18.0
[PATCH 4/4] staging:rtl8192u: Remove typedef from enum opt_rst_type_e - Style
Remove the typedef directive from enumerated type opt_rst_type_e, this change clears the checkpatch issue with defining new types in the code. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r819xU_firmware.c | 2 +- drivers/staging/rtl8192u/r819xU_firmware.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c index 15fd026638fe..c3ea906f3af3 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.c +++ b/drivers/staging/rtl8192u/r819xU_firmware.c @@ -208,7 +208,7 @@ bool init_firmware(struct net_device *dev) u32 file_length = 0; u8 *mapped_file = NULL; u32 init_step = 0; - opt_rst_type_e rst_opt = OPT_SYSTEM_RESET; + enum opt_rst_type_erst_opt = OPT_SYSTEM_RESET; enum firmware_init_step_e starting_state = FW_INIT_STEP0_BOOT; rt_firmware *pfirmware = priv->pFirmware; diff --git a/drivers/staging/rtl8192u/r819xU_firmware.h b/drivers/staging/rtl8192u/r819xU_firmware.h index 870301853480..b84344c1e62b 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.h +++ b/drivers/staging/rtl8192u/r819xU_firmware.h @@ -11,9 +11,9 @@ enum firmware_init_step_e { FW_INIT_STEP2_DATA = 2, }; -typedef enum _opt_rst_type { +enum opt_rst_type_e { OPT_SYSTEM_RESET = 0, OPT_FIRMWARE_RESET = 1, -} opt_rst_type_e; +}; #endif -- 2.18.0
[PATCH 0/4] staging:rtl8192u: Style changes r819xU_firmware.h
This short series of patches just clears simple checkpatch issues with the header file r819xU_firmware.h. John Whitmore (4): staging:rtl8192u: Remove unused RTL8190_CPU_START_OFFSET - Style staging:rtl8192u: Refactor GET_COMMAND_PACKET_FRAG_THRESHOLD - Style staging:rtl8192u: Remove typedef from firmware_init_step_e - Style staging:rtl8192u: Remove typedef from enum opt_rst_type_e - Style drivers/staging/rtl8192u/r819xU_firmware.c | 4 ++-- drivers/staging/rtl8192u/r819xU_firmware.h | 11 +-- 2 files changed, 7 insertions(+), 8 deletions(-) -- 2.18.0
[PATCH 1/4] staging:rtl8192u: Remove unused RTL8190_CPU_START_OFFSET - Style
The defined constant RTL8190_CPU_START_OFFSET is not used in the code so has been removed. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r819xU_firmware.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.h b/drivers/staging/rtl8192u/r819xU_firmware.h index cccd1c82ffe0..794dca7dcd95 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.h +++ b/drivers/staging/rtl8192u/r819xU_firmware.h @@ -2,7 +2,6 @@ #ifndef __INC_FIRMWARE_H #define __INC_FIRMWARE_H -#define RTL8190_CPU_START_OFFSET 0x80 #define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) \ (4*(v/4) - 8 - USB_HWDESC_HEADER_LEN) -- 2.18.0
[PATCH 2/4] staging:rtl8192u: Refactor GET_COMMAND_PACKET_FRAG_THRESHOLD - Style
The MACRO GET_COMMAND_PACKET_FRAG_THRESHOLD causes a number of checkpatch issues so has been refactored to use braces around the parameter 'v' to avoid precedence issues, and to add spaces around operators. These changes are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r819xU_firmware.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.h b/drivers/staging/rtl8192u/r819xU_firmware.h index 794dca7dcd95..e78e547044b4 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.h +++ b/drivers/staging/rtl8192u/r819xU_firmware.h @@ -3,7 +3,7 @@ #define __INC_FIRMWARE_H #define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) \ - (4*(v/4) - 8 - USB_HWDESC_HEADER_LEN) + (4 * ((v) / 4) - 8 - USB_HWDESC_HEADER_LEN) typedef enum _firmware_init_step { FW_INIT_STEP0_BOOT = 0, -- 2.18.0
[PATCH 1/4] staging:rtl8192u: Remove unused RTL8190_CPU_START_OFFSET - Style
The defined constant RTL8190_CPU_START_OFFSET is not used in the code so has been removed. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r819xU_firmware.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.h b/drivers/staging/rtl8192u/r819xU_firmware.h index cccd1c82ffe0..794dca7dcd95 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.h +++ b/drivers/staging/rtl8192u/r819xU_firmware.h @@ -2,7 +2,6 @@ #ifndef __INC_FIRMWARE_H #define __INC_FIRMWARE_H -#define RTL8190_CPU_START_OFFSET 0x80 #define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) \ (4*(v/4) - 8 - USB_HWDESC_HEADER_LEN) -- 2.18.0
[PATCH 2/4] staging:rtl8192u: Refactor GET_COMMAND_PACKET_FRAG_THRESHOLD - Style
The MACRO GET_COMMAND_PACKET_FRAG_THRESHOLD causes a number of checkpatch issues so has been refactored to use braces around the parameter 'v' to avoid precedence issues, and to add spaces around operators. These changes are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r819xU_firmware.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.h b/drivers/staging/rtl8192u/r819xU_firmware.h index 794dca7dcd95..e78e547044b4 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.h +++ b/drivers/staging/rtl8192u/r819xU_firmware.h @@ -3,7 +3,7 @@ #define __INC_FIRMWARE_H #define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) \ - (4*(v/4) - 8 - USB_HWDESC_HEADER_LEN) + (4 * ((v) / 4) - 8 - USB_HWDESC_HEADER_LEN) typedef enum _firmware_init_step { FW_INIT_STEP0_BOOT = 0, -- 2.18.0
[PATCH 0/1] staging:rtl8192u: Fix naming clash of exported symbol
Not sure of the procedure having made a mess of the build, (by reusing the name of an exported symbol). I hope that given the obscurity of rtl1892u this doesn't cause people issues. Obviously given the fact that I renamed an exported symbol I should have checked the name. Newbie mistake, I can only apologise for the oversight, sorry. John Whitmore (1): staging:rtl8192u: Rename dot11d_init to fix name clash drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) -- 2.18.0
[PATCH 0/1] staging:rtl8192u: Fix naming clash of exported symbol
Not sure of the procedure having made a mess of the build, (by reusing the name of an exported symbol). I hope that given the obscurity of rtl1892u this doesn't cause people issues. Obviously given the fact that I renamed an exported symbol I should have checked the name. Newbie mistake, I can only apologise for the oversight, sorry. John Whitmore (1): staging:rtl8192u: Rename dot11d_init to fix name clash drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) -- 2.18.0
[PATCH 1/1] staging:rtl8192u: Rename dot11d_init to fix name clash
The function dot11d_init() was previously renamed to clear a style issue. Unfortunately the new name used, dot11d_init(), clashes with a sybmol which is exported with the same name. To correct this problem the function has been renamed to rtl8192u_dot11d_init(). Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c b/drivers/staging/rtl8192u/ieee80211/dot11d.c index d3b13f0cfc09..3c8e8ba999cf 100644 --- a/drivers/staging/rtl8192u/ieee80211/dot11d.c +++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c @@ -3,7 +3,7 @@ #include "dot11d.h" -void dot11d_init(struct ieee80211_device *ieee) +void rtl8192u_dot11d_init(struct ieee80211_device *ieee) { struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee); @@ -15,9 +15,9 @@ void dot11d_init(struct ieee80211_device *ieee) memset(pDot11dInfo->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER+1); RESET_CIE_WATCHDOG(ieee); - netdev_info(ieee->dev, "dot11d_init()\n"); + netdev_info(ieee->dev, "rtl8192u_dot11d_init()\n"); } -EXPORT_SYMBOL(dot11d_init); +EXPORT_SYMBOL(rtl8192u_dot11d_init); /* Reset to the state as we are just entering a regulatory domain. */ void dot11d_reset(struct ieee80211_device *ieee) diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h b/drivers/staging/rtl8192u/ieee80211/dot11d.h index be59f720ae20..d217eb8063c4 100644 --- a/drivers/staging/rtl8192u/ieee80211/dot11d.h +++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h @@ -43,7 +43,7 @@ struct rt_dot11d_info { #define RESET_CIE_WATCHDOG(ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0) #define UPDATE_CIE_WATCHDOG(ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev)) -void dot11d_init(struct ieee80211_device *dev); +void rtl8192u_dot11d_init(struct ieee80211_device *dev); void dot11d_reset(struct ieee80211_device *dev); void dot11d_update_country_ie(struct ieee80211_device *dev, u8 *addr, diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 6b22aaa40ff9..0a21a76dcbc3 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -183,7 +183,7 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv) case COUNTRY_CODE_ISRAEL: case COUNTRY_CODE_TELEC: case COUNTRY_CODE_MIC: - dot11d_init(ieee); + rtl8192u_dot11d_init(ieee); ieee->bGlobalDomain = false; /* actually 8225 & 8256 rf chips only support B,G,24N mode */ if ((priv->rf_chip == RF_8225) || (priv->rf_chip == RF_8256)) { -- 2.18.0
[PATCH 1/1] staging:rtl8192u: Rename dot11d_init to fix name clash
The function dot11d_init() was previously renamed to clear a style issue. Unfortunately the new name used, dot11d_init(), clashes with a sybmol which is exported with the same name. To correct this problem the function has been renamed to rtl8192u_dot11d_init(). Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c b/drivers/staging/rtl8192u/ieee80211/dot11d.c index d3b13f0cfc09..3c8e8ba999cf 100644 --- a/drivers/staging/rtl8192u/ieee80211/dot11d.c +++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c @@ -3,7 +3,7 @@ #include "dot11d.h" -void dot11d_init(struct ieee80211_device *ieee) +void rtl8192u_dot11d_init(struct ieee80211_device *ieee) { struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee); @@ -15,9 +15,9 @@ void dot11d_init(struct ieee80211_device *ieee) memset(pDot11dInfo->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER+1); RESET_CIE_WATCHDOG(ieee); - netdev_info(ieee->dev, "dot11d_init()\n"); + netdev_info(ieee->dev, "rtl8192u_dot11d_init()\n"); } -EXPORT_SYMBOL(dot11d_init); +EXPORT_SYMBOL(rtl8192u_dot11d_init); /* Reset to the state as we are just entering a regulatory domain. */ void dot11d_reset(struct ieee80211_device *ieee) diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h b/drivers/staging/rtl8192u/ieee80211/dot11d.h index be59f720ae20..d217eb8063c4 100644 --- a/drivers/staging/rtl8192u/ieee80211/dot11d.h +++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h @@ -43,7 +43,7 @@ struct rt_dot11d_info { #define RESET_CIE_WATCHDOG(ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0) #define UPDATE_CIE_WATCHDOG(ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev)) -void dot11d_init(struct ieee80211_device *dev); +void rtl8192u_dot11d_init(struct ieee80211_device *dev); void dot11d_reset(struct ieee80211_device *dev); void dot11d_update_country_ie(struct ieee80211_device *dev, u8 *addr, diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 6b22aaa40ff9..0a21a76dcbc3 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -183,7 +183,7 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv) case COUNTRY_CODE_ISRAEL: case COUNTRY_CODE_TELEC: case COUNTRY_CODE_MIC: - dot11d_init(ieee); + rtl8192u_dot11d_init(ieee); ieee->bGlobalDomain = false; /* actually 8225 & 8256 rf chips only support B,G,24N mode */ if ((priv->rf_chip == RF_8225) || (priv->rf_chip == RF_8256)) { -- 2.18.0
Re: linux-next: build warning after merge of the staging tree
On Mon, Sep 03, 2018 at 12:06:17PM +1000, Stephen Rothwell wrote: > Hi Greg, > > After merging the staging tree, today's linux-next build (powerpc > allyesconfig) produced this warning: > > WARNING: drivers/staging/rtl8192u/r8192u_usb: 'dot11d_init' exported twice. > Previous export was in drivers/staging/rtl8192e/rtllib.ko > > Introduced by commit > > c01f06b7506f ("staging:rtl8192u: Rename Dot11d_Init - Style") > > -- > Cheers, > Stephen Rothwell Aragh, sorry my bad, and a newbie mistake. I now know to do more of a check for exported symbols. If it had occured to me I'd not have touched it. I'm not sure what the procedure is, having written my first bug, but I'll submit a patch to revert that change. jwhitmore
Re: linux-next: build warning after merge of the staging tree
On Mon, Sep 03, 2018 at 12:06:17PM +1000, Stephen Rothwell wrote: > Hi Greg, > > After merging the staging tree, today's linux-next build (powerpc > allyesconfig) produced this warning: > > WARNING: drivers/staging/rtl8192u/r8192u_usb: 'dot11d_init' exported twice. > Previous export was in drivers/staging/rtl8192e/rtllib.ko > > Introduced by commit > > c01f06b7506f ("staging:rtl8192u: Rename Dot11d_Init - Style") > > -- > Cheers, > Stephen Rothwell Aragh, sorry my bad, and a newbie mistake. I now know to do more of a check for exported symbols. If it had occured to me I'd not have touched it. I'm not sure what the procedure is, having written my first bug, but I'll submit a patch to revert that change. jwhitmore
[PATCH 07/20] staging:rtl8192u: Refactor RT_TRACE - Style
Refactor the MACRO RT_TRACE to add parentheses around the parameter 'component', this clears the checkpatch warning with respect to precedence issues. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index b5ad69af8dac..c613894a6088 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -52,7 +52,7 @@ extern u32 rt_global_debug_component; #define RT_TRACE(component, x, args...) \ do {\ - if (rt_global_debug_component & component) \ + if (rt_global_debug_component & (component))\ pr_debug("RTL8192U: " x "\n", ##args); \ } while (0) -- 2.18.0
[PATCH 05/20] staging:rtl8192u: Rename RTL819xU_MODULE_NAME - Style
Rename the MACRO RTL819xU_MODULE_NAME to RTL819XU_MODULE_NAME, this clears the checkpatch issue with CamelCase naming. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 4dcfcb4d3911..81a7072a6285 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -40,7 +40,7 @@ #include "ieee80211/ieee80211.h" #define RTL8192U -#define RTL819xU_MODULE_NAME "rtl819xU" +#define RTL819XU_MODULE_NAME "rtl819xU" /* HW security */ #define MAX_KEY_LEN 61 #define KEY_BUF_SIZE5 diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 98bb40c50f40..b3d32ea29fee 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -128,7 +128,7 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf); static struct usb_driver rtl8192_usb_driver = { - .name = RTL819xU_MODULE_NAME, /* Driver name */ + .name = RTL819XU_MODULE_NAME, /* Driver name */ .id_table = rtl8192_usb_id_tbl, /* PCI_ID table */ .probe = rtl8192_usb_probe, /* probe fn */ .disconnect = rtl8192_usb_disconnect, /* remove fn */ @@ -627,7 +627,7 @@ static int __maybe_unused proc_get_stats_rx(struct seq_file *m, void *v) static void rtl8192_proc_module_init(void) { RT_TRACE(COMP_INIT, "Initializing proc filesystem"); - rtl8192_proc = proc_mkdir(RTL819xU_MODULE_NAME, init_net.proc_net); + rtl8192_proc = proc_mkdir(RTL819XU_MODULE_NAME, init_net.proc_net); } static void rtl8192_proc_init_one(struct net_device *dev) -- 2.18.0
[PATCH 05/20] staging:rtl8192u: Rename RTL819xU_MODULE_NAME - Style
Rename the MACRO RTL819xU_MODULE_NAME to RTL819XU_MODULE_NAME, this clears the checkpatch issue with CamelCase naming. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 4dcfcb4d3911..81a7072a6285 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -40,7 +40,7 @@ #include "ieee80211/ieee80211.h" #define RTL8192U -#define RTL819xU_MODULE_NAME "rtl819xU" +#define RTL819XU_MODULE_NAME "rtl819xU" /* HW security */ #define MAX_KEY_LEN 61 #define KEY_BUF_SIZE5 diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 98bb40c50f40..b3d32ea29fee 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -128,7 +128,7 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf); static struct usb_driver rtl8192_usb_driver = { - .name = RTL819xU_MODULE_NAME, /* Driver name */ + .name = RTL819XU_MODULE_NAME, /* Driver name */ .id_table = rtl8192_usb_id_tbl, /* PCI_ID table */ .probe = rtl8192_usb_probe, /* probe fn */ .disconnect = rtl8192_usb_disconnect, /* remove fn */ @@ -627,7 +627,7 @@ static int __maybe_unused proc_get_stats_rx(struct seq_file *m, void *v) static void rtl8192_proc_module_init(void) { RT_TRACE(COMP_INIT, "Initializing proc filesystem"); - rtl8192_proc = proc_mkdir(RTL819xU_MODULE_NAME, init_net.proc_net); + rtl8192_proc = proc_mkdir(RTL819XU_MODULE_NAME, init_net.proc_net); } static void rtl8192_proc_init_one(struct net_device *dev) -- 2.18.0
[PATCH 07/20] staging:rtl8192u: Refactor RT_TRACE - Style
Refactor the MACRO RT_TRACE to add parentheses around the parameter 'component', this clears the checkpatch warning with respect to precedence issues. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index b5ad69af8dac..c613894a6088 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -52,7 +52,7 @@ extern u32 rt_global_debug_component; #define RT_TRACE(component, x, args...) \ do {\ - if (rt_global_debug_component & component) \ + if (rt_global_debug_component & (component))\ pr_debug("RTL8192U: " x "\n", ##args); \ } while (0) -- 2.18.0
[PATCH 03/20] staging:rtl8192u: Remove unused functions - Style
Remove unused function declarations. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 10 -- drivers/staging/rtl8192u/r8192U_core.c | 7 --- 2 files changed, 17 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 70bbd1fadcca..b3e6ce2acedb 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -1103,22 +1103,12 @@ void force_pci_posting(struct net_device *dev); void rtl8192_rtx_disable(struct net_device *dev); void rtl8192_rx_enable(struct net_device *dev); -void rtl8192_tx_enable(struct net_device *dev); -void rtl8192_disassociate(struct net_device *dev); -void rtl8185_set_rf_pins_enable(struct net_device *dev, u32 a); - -void rtl8192_set_anaparam(struct net_device *dev, u32 a); -void rtl8185_set_anaparam2(struct net_device *dev, u32 a); void rtl8192_update_msr(struct net_device *dev); int rtl8192_down(struct net_device *dev); int rtl8192_up(struct net_device *dev); void rtl8192_commit(struct net_device *dev); void rtl8192_set_chan(struct net_device *dev, short ch); -void write_phy(struct net_device *dev, u8 adr, u8 data); -void write_phy_cck(struct net_device *dev, u8 adr, u32 data); -void write_phy_ofdm(struct net_device *dev, u8 adr, u32 data); -void rtl8185_tx_antenna(struct net_device *dev, u8 ant); void rtl8192_set_rxconf(struct net_device *dev); void rtl819xusb_beacon_tx(struct net_device *dev, u16 tx_rate); diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 12783b88eb58..98bb40c50f40 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -830,13 +830,6 @@ void rtl8192_rx_enable(struct net_device *dev) rtl8192_rx_initiate(dev); } - -void rtl8192_tx_enable(struct net_device *dev) -{ -} - - - void rtl8192_rtx_disable(struct net_device *dev) { u8 cmd; -- 2.18.0
[PATCH 09/20] staging:rtl8192u: Remove RT_DEBUG_DATA - Style
Remove the RT_DEBUG_DATA Macro. The macro causes a number of checkpatch issues, and is not actually used in code, so can simply be removed without issue. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 20 1 file changed, 20 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index e65a893fd084..528c50be3894 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -103,28 +103,8 @@ extern u32 rt_global_debug_component; #expr, __FILE__, __func__, __LINE__); \ } \ } while (0) -/* - * Debug out data buf. - * If you want to print DATA buffer related BA, - * please set ieee80211_debug_level to DATA|BA - */ -#define RT_DEBUG_DATA(level, data, datalen) \ - do {\ - if ((rt_global_debug_component & (level)) == (level)) { \ - int i; \ - u8 *pdata = (u8 *)data; \ - pr_debug("RTL8192U: %s()\n", __func__); \ - for (i = 0; i < (int)(datalen); i++) { \ - printk("%2x ", pdata[i]); \ - if ((i+1)%16 == 0) \ - printk("\n"); \ - } \ - printk("\n"); \ - } \ - } while (0) #else #define RTL8192U_ASSERT(expr) do {} while (0) -#define RT_DEBUG_DATA(level, data, datalen) do {} while (0) #endif /* RTL8169_DEBUG */ /* Queue Select Value in TxDesc */ -- 2.18.0
[PATCH 03/20] staging:rtl8192u: Remove unused functions - Style
Remove unused function declarations. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 10 -- drivers/staging/rtl8192u/r8192U_core.c | 7 --- 2 files changed, 17 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 70bbd1fadcca..b3e6ce2acedb 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -1103,22 +1103,12 @@ void force_pci_posting(struct net_device *dev); void rtl8192_rtx_disable(struct net_device *dev); void rtl8192_rx_enable(struct net_device *dev); -void rtl8192_tx_enable(struct net_device *dev); -void rtl8192_disassociate(struct net_device *dev); -void rtl8185_set_rf_pins_enable(struct net_device *dev, u32 a); - -void rtl8192_set_anaparam(struct net_device *dev, u32 a); -void rtl8185_set_anaparam2(struct net_device *dev, u32 a); void rtl8192_update_msr(struct net_device *dev); int rtl8192_down(struct net_device *dev); int rtl8192_up(struct net_device *dev); void rtl8192_commit(struct net_device *dev); void rtl8192_set_chan(struct net_device *dev, short ch); -void write_phy(struct net_device *dev, u8 adr, u8 data); -void write_phy_cck(struct net_device *dev, u8 adr, u32 data); -void write_phy_ofdm(struct net_device *dev, u8 adr, u32 data); -void rtl8185_tx_antenna(struct net_device *dev, u8 ant); void rtl8192_set_rxconf(struct net_device *dev); void rtl819xusb_beacon_tx(struct net_device *dev, u16 tx_rate); diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 12783b88eb58..98bb40c50f40 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -830,13 +830,6 @@ void rtl8192_rx_enable(struct net_device *dev) rtl8192_rx_initiate(dev); } - -void rtl8192_tx_enable(struct net_device *dev) -{ -} - - - void rtl8192_rtx_disable(struct net_device *dev) { u8 cmd; -- 2.18.0
[PATCH 09/20] staging:rtl8192u: Remove RT_DEBUG_DATA - Style
Remove the RT_DEBUG_DATA Macro. The macro causes a number of checkpatch issues, and is not actually used in code, so can simply be removed without issue. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 20 1 file changed, 20 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index e65a893fd084..528c50be3894 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -103,28 +103,8 @@ extern u32 rt_global_debug_component; #expr, __FILE__, __func__, __LINE__); \ } \ } while (0) -/* - * Debug out data buf. - * If you want to print DATA buffer related BA, - * please set ieee80211_debug_level to DATA|BA - */ -#define RT_DEBUG_DATA(level, data, datalen) \ - do {\ - if ((rt_global_debug_component & (level)) == (level)) { \ - int i; \ - u8 *pdata = (u8 *)data; \ - pr_debug("RTL8192U: %s()\n", __func__); \ - for (i = 0; i < (int)(datalen); i++) { \ - printk("%2x ", pdata[i]); \ - if ((i+1)%16 == 0) \ - printk("\n"); \ - } \ - printk("\n"); \ - } \ - } while (0) #else #define RTL8192U_ASSERT(expr) do {} while (0) -#define RT_DEBUG_DATA(level, data, datalen) do {} while (0) #endif /* RTL8169_DEBUG */ /* Queue Select Value in TxDesc */ -- 2.18.0
[PATCH 19/20] staging:rtl8192u: Rename LINIP - Style
Rename the member variable 'LINIP' to 'linip', this change is to conform to the coding style guidelines, member variables in lowercase. This is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 66efa59eabf0..68e82b32a88e 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -164,7 +164,7 @@ struct tx_desc_819x_usb { u8 cmd_init:1; u8 last_seg:1; u8 first_seg:1; - u8 LINIP:1; + u8 linip:1; u8 OWN:1; /* DWORD 1 */ diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index a4d1b55a1117..911d0214b48a 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1514,7 +1514,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) /* Fill Tx descriptor */ memset(tx_desc, 0, sizeof(struct tx_desc_819x_usb)); /* DWORD 0 */ - tx_desc->LINIP = 0; + tx_desc->linip = 0; tx_desc->cmd_init = 1; tx_desc->offset = sizeof(struct tx_fwinfo_819x_usb) + 8; tx_desc->pkt_size = (skb->len - TX_PACKET_SHIFT_BYTES) & 0x; -- 2.18.0
[PATCH 14/20] staging:rtl8192u: Rename Offset - Style
Rename the member variable 'Offset' to 'offset', this clears the checkpatch issue with CamelCase naming. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 9931ede1524b..8aaea1d8cf50 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -159,7 +159,7 @@ extern u32 rt_global_debug_component; struct tx_desc_819x_usb { /* DWORD 0 */ u16 pkt_size; - u8 Offset; + u8 offset; u8 Reserved0:3; u8 CmdInit:1; u8 LastSeg:1; diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 2a3cb0f1ac07..d4af6cc01fc6 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1516,7 +1516,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) /* DWORD 0 */ tx_desc->LINIP = 0; tx_desc->CmdInit = 1; - tx_desc->Offset = sizeof(struct tx_fwinfo_819x_usb) + 8; + tx_desc->offset = sizeof(struct tx_fwinfo_819x_usb) + 8; tx_desc->pkt_size = (skb->len - TX_PACKET_SHIFT_BYTES) & 0x; /*DWORD 1*/ -- 2.18.0
[PATCH 20/20] staging:rtl8192u: Rename OWN - Style
Rename the member variable 'OWN' to 'own', this is to comply with the coding standard, where variables are named in lowercase. This is a simple coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 68e82b32a88e..f963b664e221 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -165,7 +165,7 @@ struct tx_desc_819x_usb { u8 last_seg:1; u8 first_seg:1; u8 linip:1; - u8 OWN:1; + u8 own:1; /* DWORD 1 */ u8 TxFWInfoSize; diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 911d0214b48a..4d0f70ec31ac 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1558,7 +1558,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) /* DWORD 0 */ tx_desc->first_seg = 1; tx_desc->last_seg = 1; - tx_desc->OWN = 1; + tx_desc->own = 1; /* DWORD 2 */ tx_desc->TxBufferSize = (u32)(skb->len - USB_HWDESC_HEADER_LEN); -- 2.18.0
[PATCH 02/20] staging:rtl8192u: Remove read_cam() - Style
Remove the function read_cam(), as it is unused in code. Simple style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 -- drivers/staging/rtl8192u/r8192U_core.c | 9 - 2 files changed, 11 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 77324a471de1..70bbd1fadcca 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -1091,8 +1091,6 @@ bool init_firmware(struct net_device *dev); short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb); short rtl8192_tx(struct net_device *dev, struct sk_buff *skb); -u32 read_cam(struct net_device *dev, u8 addr); - int read_nic_byte(struct net_device *dev, int x, u8 *data); int read_nic_byte_E(struct net_device *dev, int x, u8 *data); int read_nic_dword(struct net_device *dev, int x, u32 *data); diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index caa618a845df..12783b88eb58 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -237,15 +237,6 @@ static void CamResetAllEntry(struct net_device *dev) write_nic_dword(dev, RWCAM, ulcommand); } -u32 read_cam(struct net_device *dev, u8 addr) -{ - u32 data; - - write_nic_dword(dev, RWCAM, 0x8000 | (addr & 0xff)); - read_nic_dword(dev, 0xa8, ); - return data; -} - int write_nic_byte_E(struct net_device *dev, int indx, u8 data) { int status; -- 2.18.0
[PATCH 01/20] staging:rtl8192u: Remove write_cam() - Style
Remove the function write_cam() as it is unused. Simple style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 1 - drivers/staging/rtl8192u/r8192U_core.c | 7 --- 2 files changed, 8 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 1b51601df1ee..77324a471de1 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -1092,7 +1092,6 @@ short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb); short rtl8192_tx(struct net_device *dev, struct sk_buff *skb); u32 read_cam(struct net_device *dev, u8 addr); -void write_cam(struct net_device *dev, u8 addr, u32 data); int read_nic_byte(struct net_device *dev, int x, u8 *data); int read_nic_byte_E(struct net_device *dev, int x, u8 *data); diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 6b22aaa40ff9..caa618a845df 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -237,13 +237,6 @@ static void CamResetAllEntry(struct net_device *dev) write_nic_dword(dev, RWCAM, ulcommand); } - -void write_cam(struct net_device *dev, u8 addr, u32 data) -{ - write_nic_dword(dev, WCAMI, data); - write_nic_dword(dev, RWCAM, BIT(31) | BIT(16) | (addr & 0xff)); -} - u32 read_cam(struct net_device *dev, u8 addr) { u32 data; -- 2.18.0
[PATCH 12/20] staging:rtl8192u: Rename CCK_Table_length - Style
Rename the constant CCK_Table_length to CCK_TABLE_LENGTH, this clears the checkpatch issue with CamelCase naming. This is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h| 2 +- drivers/staging/rtl8192u/r8192U_dm.c | 14 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 6edbc8146e82..e86a4b35a1f4 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -153,7 +153,7 @@ extern u32 rt_global_debug_component; #definePHY_BEACON_RSSI_SLID_WIN_MAX10 /* For Tx Power Tracking */ #defineOFDM_TABLE_LENGTH 19 -#defineCCK_Table_length12 +#defineCCK_TABLE_LENGTH12 /* For rtl819x */ struct tx_desc_819x_usb { diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 19b3b11c5edb..874da0620936 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -476,7 +476,7 @@ static u32 OFDMSwingTable[OFDM_TABLE_LENGTH] = { 0x1040 /* 18, -12db */ }; -static u8 CCKSwingTable_Ch1_Ch13[CCK_Table_length][8] = { +static u8 CCKSwingTable_Ch1_Ch13[CCK_TABLE_LENGTH][8] = { {0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04}, /* 0, +0db ===> CCK40M default */ {0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, /* 1, -1db */ {0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, /* 2, -2db */ @@ -491,7 +491,7 @@ static u8 CCKSwingTable_Ch1_Ch13[CCK_Table_length][8] = { {0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}/* 11, -11db */ }; -static u8 CCKSwingTable_Ch14[CCK_Table_length][8] = { +static u8 CCKSwingTable_Ch14[CCK_TABLE_LENGTH][8] = { {0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00}, /* 0, +0db ===> CCK40M default */ {0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, /* 1, -1db */ {0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, /* 2, -2db */ @@ -682,7 +682,7 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev) /* Query CCK default setting From 0xa22 */ TempCCk = rtl8192_QueryBBReg(dev, rCCK0_TxFilter1, bMaskByte2); - for (i = 0; i < CCK_Table_length; i++) { + for (i = 0; i < CCK_TABLE_LENGTH; i++) { if (TempCCk == (u32)CCKSwingTable_Ch1_Ch13[i][0]) { priv->CCK_index = (u8) i; RT_TRACE(COMP_POWER_TRACKING, "Initial reg0x%x = 0x%x, CCK_index=0x%x\n", @@ -718,10 +718,10 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev) tmpCCK40Mindex = tmpCCK20Mindex - 6; if (tmpOFDMindex >= OFDM_TABLE_LENGTH) tmpOFDMindex = OFDM_TABLE_LENGTH - 1; - if (tmpCCK20Mindex >= CCK_Table_length) - tmpCCK20Mindex = CCK_Table_length-1; - if (tmpCCK40Mindex >= CCK_Table_length) - tmpCCK40Mindex = CCK_Table_length-1; + if (tmpCCK20Mindex >= CCK_TABLE_LENGTH) + tmpCCK20Mindex = CCK_TABLE_LENGTH - 1; + if (tmpCCK40Mindex >= CCK_TABLE_LENGTH) + tmpCCK40Mindex = CCK_TABLE_LENGTH - 1; } else { tmpval = (u8)tmpRegA - priv->ThermalMeter[0]; -- 2.18.0
[PATCH 16/20] staging:rtl8192u: Rename CmdInit - Style
Rename the member variable 'CmdInit, to 'cmd_init', this change clears the checkpatch issue with CamelCase naming. This is a simple coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 5d643870a1e3..4d29b7427a0e 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -161,7 +161,7 @@ struct tx_desc_819x_usb { u16 pkt_size; u8 offset; u8 reserved0:3; - u8 CmdInit:1; + u8 cmd_init:1; u8 LastSeg:1; u8 FirstSeg:1; u8 LINIP:1; diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index d4af6cc01fc6..b385c686370b 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1515,7 +1515,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) memset(tx_desc, 0, sizeof(struct tx_desc_819x_usb)); /* DWORD 0 */ tx_desc->LINIP = 0; - tx_desc->CmdInit = 1; + tx_desc->cmd_init = 1; tx_desc->offset = sizeof(struct tx_fwinfo_819x_usb) + 8; tx_desc->pkt_size = (skb->len - TX_PACKET_SHIFT_BYTES) & 0x; -- 2.18.0
[PATCH 04/20] staging:rtl8192u: Add SPDX-License-Identifier - Style
Add SPDX-License-Identifier tag to the start of header file. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index b3e6ce2acedb..4dcfcb4d3911 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This is part of rtl8187 OpenSource driver. * Copyright (C) Andrea Merello 2004-2005 -- 2.18.0
[PATCH 06/20] staging:rtl8192u: Rename Rx_Smooth_Factor - Style
Rename the MACRO Rx_Smooth_Factor to RX_SMOOTH_FACTOR, this clears the checkpatch issue with CamelCase naming. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 20 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 81a7072a6285..b5ad69af8dac 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -45,7 +45,7 @@ #define MAX_KEY_LEN 61 #define KEY_BUF_SIZE5 -#defineRx_Smooth_Factor20 +#defineRX_SMOOTH_FACTOR20 #define DMESG(x, a...) #define DMESGW(x, a...) #define DMESGE(x, a...) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index b3d32ea29fee..dd87cee6604b 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -3975,13 +3975,13 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer, pprevious_stats->RxMIMOSignalStrength[rfpath]; if (pprevious_stats->RxMIMOSignalStrength[rfpath] > priv->stats.rx_rssi_percentage[rfpath]) { priv->stats.rx_rssi_percentage[rfpath] = - ((priv->stats.rx_rssi_percentage[rfpath] * (Rx_Smooth_Factor - 1)) + - (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (Rx_Smooth_Factor); + ((priv->stats.rx_rssi_percentage[rfpath] * (RX_SMOOTH_FACTOR - 1)) + + (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (RX_SMOOTH_FACTOR); priv->stats.rx_rssi_percentage[rfpath] = priv->stats.rx_rssi_percentage[rfpath] + 1; } else { priv->stats.rx_rssi_percentage[rfpath] = - ((priv->stats.rx_rssi_percentage[rfpath] * (Rx_Smooth_Factor - 1)) + - (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (Rx_Smooth_Factor); + ((priv->stats.rx_rssi_percentage[rfpath] * (RX_SMOOTH_FACTOR - 1)) + + (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (RX_SMOOTH_FACTOR); } RT_TRACE(COMP_DBG, "priv->stats.rx_rssi_percentage[rfPath] = %d\n", @@ -4026,13 +4026,13 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer, pprevious_stats->RxPWDBAll; if (pprevious_stats->RxPWDBAll > (u32)priv->undecorated_smoothed_pwdb) { priv->undecorated_smoothed_pwdb = - (((priv->undecorated_smoothed_pwdb) * (Rx_Smooth_Factor - 1)) + -(pprevious_stats->RxPWDBAll)) / (Rx_Smooth_Factor); + (((priv->undecorated_smoothed_pwdb) * (RX_SMOOTH_FACTOR - 1)) + +(pprevious_stats->RxPWDBAll)) / (RX_SMOOTH_FACTOR); priv->undecorated_smoothed_pwdb = priv->undecorated_smoothed_pwdb + 1; } else { priv->undecorated_smoothed_pwdb = - (((priv->undecorated_smoothed_pwdb) * (Rx_Smooth_Factor - 1)) + -(pprevious_stats->RxPWDBAll)) / (Rx_Smooth_Factor); + (((priv->undecorated_smoothed_pwdb) * (RX_SMOOTH_FACTOR - 1)) + +(pprevious_stats->RxPWDBAll)) / (RX_SMOOTH_FACTOR); } } @@ -4075,8 +4075,8 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer, if (priv->stats.rx_evm_percentage[nspatial_stream] == 0) /* initialize */ priv->stats.rx_evm_percentage[nspatial_stream] = pprevious_stats->RxMIMOSignalQuality[nspatial_stream]; priv->stats.rx_evm_percentage[nspatial_stream] = - ((priv->stats.rx_evm_percentage[nspatial_stream] * (Rx_Smooth_Factor - 1)) + - (pprevious_stats->RxMIMOSignalQuality[nspatial_stream] * 1)) / (Rx_Smooth_Factor); + ((priv->stats.rx_evm_percentage[nspatial_stream] * (RX_SMOOTH_FACTOR - 1)) + +
[PATCH 20/20] staging:rtl8192u: Rename OWN - Style
Rename the member variable 'OWN' to 'own', this is to comply with the coding standard, where variables are named in lowercase. This is a simple coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 68e82b32a88e..f963b664e221 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -165,7 +165,7 @@ struct tx_desc_819x_usb { u8 last_seg:1; u8 first_seg:1; u8 linip:1; - u8 OWN:1; + u8 own:1; /* DWORD 1 */ u8 TxFWInfoSize; diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 911d0214b48a..4d0f70ec31ac 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1558,7 +1558,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) /* DWORD 0 */ tx_desc->first_seg = 1; tx_desc->last_seg = 1; - tx_desc->OWN = 1; + tx_desc->own = 1; /* DWORD 2 */ tx_desc->TxBufferSize = (u32)(skb->len - USB_HWDESC_HEADER_LEN); -- 2.18.0
[PATCH 02/20] staging:rtl8192u: Remove read_cam() - Style
Remove the function read_cam(), as it is unused in code. Simple style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 -- drivers/staging/rtl8192u/r8192U_core.c | 9 - 2 files changed, 11 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 77324a471de1..70bbd1fadcca 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -1091,8 +1091,6 @@ bool init_firmware(struct net_device *dev); short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb); short rtl8192_tx(struct net_device *dev, struct sk_buff *skb); -u32 read_cam(struct net_device *dev, u8 addr); - int read_nic_byte(struct net_device *dev, int x, u8 *data); int read_nic_byte_E(struct net_device *dev, int x, u8 *data); int read_nic_dword(struct net_device *dev, int x, u32 *data); diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index caa618a845df..12783b88eb58 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -237,15 +237,6 @@ static void CamResetAllEntry(struct net_device *dev) write_nic_dword(dev, RWCAM, ulcommand); } -u32 read_cam(struct net_device *dev, u8 addr) -{ - u32 data; - - write_nic_dword(dev, RWCAM, 0x8000 | (addr & 0xff)); - read_nic_dword(dev, 0xa8, ); - return data; -} - int write_nic_byte_E(struct net_device *dev, int indx, u8 data) { int status; -- 2.18.0
[PATCH 01/20] staging:rtl8192u: Remove write_cam() - Style
Remove the function write_cam() as it is unused. Simple style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 1 - drivers/staging/rtl8192u/r8192U_core.c | 7 --- 2 files changed, 8 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 1b51601df1ee..77324a471de1 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -1092,7 +1092,6 @@ short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb); short rtl8192_tx(struct net_device *dev, struct sk_buff *skb); u32 read_cam(struct net_device *dev, u8 addr); -void write_cam(struct net_device *dev, u8 addr, u32 data); int read_nic_byte(struct net_device *dev, int x, u8 *data); int read_nic_byte_E(struct net_device *dev, int x, u8 *data); diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 6b22aaa40ff9..caa618a845df 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -237,13 +237,6 @@ static void CamResetAllEntry(struct net_device *dev) write_nic_dword(dev, RWCAM, ulcommand); } - -void write_cam(struct net_device *dev, u8 addr, u32 data) -{ - write_nic_dword(dev, WCAMI, data); - write_nic_dword(dev, RWCAM, BIT(31) | BIT(16) | (addr & 0xff)); -} - u32 read_cam(struct net_device *dev, u8 addr) { u32 data; -- 2.18.0
[PATCH 12/20] staging:rtl8192u: Rename CCK_Table_length - Style
Rename the constant CCK_Table_length to CCK_TABLE_LENGTH, this clears the checkpatch issue with CamelCase naming. This is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h| 2 +- drivers/staging/rtl8192u/r8192U_dm.c | 14 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 6edbc8146e82..e86a4b35a1f4 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -153,7 +153,7 @@ extern u32 rt_global_debug_component; #definePHY_BEACON_RSSI_SLID_WIN_MAX10 /* For Tx Power Tracking */ #defineOFDM_TABLE_LENGTH 19 -#defineCCK_Table_length12 +#defineCCK_TABLE_LENGTH12 /* For rtl819x */ struct tx_desc_819x_usb { diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 19b3b11c5edb..874da0620936 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -476,7 +476,7 @@ static u32 OFDMSwingTable[OFDM_TABLE_LENGTH] = { 0x1040 /* 18, -12db */ }; -static u8 CCKSwingTable_Ch1_Ch13[CCK_Table_length][8] = { +static u8 CCKSwingTable_Ch1_Ch13[CCK_TABLE_LENGTH][8] = { {0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04}, /* 0, +0db ===> CCK40M default */ {0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, /* 1, -1db */ {0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, /* 2, -2db */ @@ -491,7 +491,7 @@ static u8 CCKSwingTable_Ch1_Ch13[CCK_Table_length][8] = { {0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}/* 11, -11db */ }; -static u8 CCKSwingTable_Ch14[CCK_Table_length][8] = { +static u8 CCKSwingTable_Ch14[CCK_TABLE_LENGTH][8] = { {0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00}, /* 0, +0db ===> CCK40M default */ {0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, /* 1, -1db */ {0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, /* 2, -2db */ @@ -682,7 +682,7 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev) /* Query CCK default setting From 0xa22 */ TempCCk = rtl8192_QueryBBReg(dev, rCCK0_TxFilter1, bMaskByte2); - for (i = 0; i < CCK_Table_length; i++) { + for (i = 0; i < CCK_TABLE_LENGTH; i++) { if (TempCCk == (u32)CCKSwingTable_Ch1_Ch13[i][0]) { priv->CCK_index = (u8) i; RT_TRACE(COMP_POWER_TRACKING, "Initial reg0x%x = 0x%x, CCK_index=0x%x\n", @@ -718,10 +718,10 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev) tmpCCK40Mindex = tmpCCK20Mindex - 6; if (tmpOFDMindex >= OFDM_TABLE_LENGTH) tmpOFDMindex = OFDM_TABLE_LENGTH - 1; - if (tmpCCK20Mindex >= CCK_Table_length) - tmpCCK20Mindex = CCK_Table_length-1; - if (tmpCCK40Mindex >= CCK_Table_length) - tmpCCK40Mindex = CCK_Table_length-1; + if (tmpCCK20Mindex >= CCK_TABLE_LENGTH) + tmpCCK20Mindex = CCK_TABLE_LENGTH - 1; + if (tmpCCK40Mindex >= CCK_TABLE_LENGTH) + tmpCCK40Mindex = CCK_TABLE_LENGTH - 1; } else { tmpval = (u8)tmpRegA - priv->ThermalMeter[0]; -- 2.18.0
[PATCH 16/20] staging:rtl8192u: Rename CmdInit - Style
Rename the member variable 'CmdInit, to 'cmd_init', this change clears the checkpatch issue with CamelCase naming. This is a simple coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 5d643870a1e3..4d29b7427a0e 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -161,7 +161,7 @@ struct tx_desc_819x_usb { u16 pkt_size; u8 offset; u8 reserved0:3; - u8 CmdInit:1; + u8 cmd_init:1; u8 LastSeg:1; u8 FirstSeg:1; u8 LINIP:1; diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index d4af6cc01fc6..b385c686370b 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1515,7 +1515,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) memset(tx_desc, 0, sizeof(struct tx_desc_819x_usb)); /* DWORD 0 */ tx_desc->LINIP = 0; - tx_desc->CmdInit = 1; + tx_desc->cmd_init = 1; tx_desc->offset = sizeof(struct tx_fwinfo_819x_usb) + 8; tx_desc->pkt_size = (skb->len - TX_PACKET_SHIFT_BYTES) & 0x; -- 2.18.0
[PATCH 19/20] staging:rtl8192u: Rename LINIP - Style
Rename the member variable 'LINIP' to 'linip', this change is to conform to the coding style guidelines, member variables in lowercase. This is a simple coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 66efa59eabf0..68e82b32a88e 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -164,7 +164,7 @@ struct tx_desc_819x_usb { u8 cmd_init:1; u8 last_seg:1; u8 first_seg:1; - u8 LINIP:1; + u8 linip:1; u8 OWN:1; /* DWORD 1 */ diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index a4d1b55a1117..911d0214b48a 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1514,7 +1514,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) /* Fill Tx descriptor */ memset(tx_desc, 0, sizeof(struct tx_desc_819x_usb)); /* DWORD 0 */ - tx_desc->LINIP = 0; + tx_desc->linip = 0; tx_desc->cmd_init = 1; tx_desc->offset = sizeof(struct tx_fwinfo_819x_usb) + 8; tx_desc->pkt_size = (skb->len - TX_PACKET_SHIFT_BYTES) & 0x; -- 2.18.0
[PATCH 14/20] staging:rtl8192u: Rename Offset - Style
Rename the member variable 'Offset' to 'offset', this clears the checkpatch issue with CamelCase naming. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/r8192U.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 9931ede1524b..8aaea1d8cf50 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -159,7 +159,7 @@ extern u32 rt_global_debug_component; struct tx_desc_819x_usb { /* DWORD 0 */ u16 pkt_size; - u8 Offset; + u8 offset; u8 Reserved0:3; u8 CmdInit:1; u8 LastSeg:1; diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 2a3cb0f1ac07..d4af6cc01fc6 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1516,7 +1516,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) /* DWORD 0 */ tx_desc->LINIP = 0; tx_desc->CmdInit = 1; - tx_desc->Offset = sizeof(struct tx_fwinfo_819x_usb) + 8; + tx_desc->offset = sizeof(struct tx_fwinfo_819x_usb) + 8; tx_desc->pkt_size = (skb->len - TX_PACKET_SHIFT_BYTES) & 0x; /*DWORD 1*/ -- 2.18.0