staging: rtl8192e: Remove entries from struct rtl819x_ops start with .get_eeprom_size
cover staging: rtl8192e: Remove entries from struct rtl819x_ops start with .get_eeprom_size
Remove unnecessary entries from rtl819x_ops and replace them with with function names. This increases readability of the code as the reader does not always need to look up the corresponding function name.
Tested with rtl8192e
Transferred this patch over wlan connection of rtl8192e
Philipp Hortmann (11):
staging: rtl8192e: Remove entry .get_eeprom_size from struct
rtl819x_ops
staging: rtl8192e: Remove entry .init_adapter_.. from struct
rtl819x_ops
staging: rtl8192e: Remove entry .initialize_ad.. from struct
rtl819x_ops
staging: rtl8192e: Remove entry .tx_fill_descr.. from struct
rtl819x_ops
staging: rtl8192e: Remove entry .tx_fill_cmd_d.. from struct
rtl819x_ops
staging: rtl8192e: Remove entry .rx_query_stat.. from struct
rtl819x_ops
staging: rtl8192e: Remove entry .stop_adapter from struct rtl819x_ops
staging: rtl8192e: Remove entry .update_ratr_t.. from struct
rtl819x_ops staging: rtl8192e: Remove entry .irq_enable from struct rtl819x_ops
staging: rtl8192e: Remove entry .irq_disable from struct rtl819x_ops
staging: rtl8192e: Remove entry .rx_enable from struct rtl819x_ops
.../staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 42 +++++++------------ drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 20 --------- 3 files changed, 15 insertions(+), 49 deletions(-)
Signature · 1 line
2.39.2
PATCH 1/11 staging: rtl8192e: Remove entry .get_eeprom_size from struct rtl819x_ops
Remove entry .get_eeprom_size and replace it with function name rtl92e_get_eeprom_size. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +-- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -2
@@ -27,7 +27,6 @@ static char *ifname = "wlan%d";static const struct rtl819x_ops rtl819xp_ops = { .nic_type =NIC_8192E , - .get_eeprom_size = rtl92e_get_eeprom_size, .init_adapter_variable = rtl92e_init_variables, .initialize_adapter = rtl92e_start_adapter, .link_change = rtl92e_link_change,
@@ -974,7 +973,7 @@ static short _rtl92e_init(struct net_device *dev)_rtl92e_init_priv_variable (dev);_rtl92e_init_priv_lock (priv);_rtl92e_init_priv_task (dev); - priv->ops->get_eeprom_size (dev); +rtl92e_get_eeprom_size (dev); priv->ops->init_adapter_variable (dev);_rtl92e_get_channel_map (dev);
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
@@ -205,7 +205,6 @@ struct rtl8192_tx_ring {struct rtl819x_ops {enum nic_t nic_type; -void (*get_eeprom_size)(struct net_device *dev);void (*init_adapter_variable)(struct net_device *dev);void (*init_before_adapter_start)(struct net_device *dev);bool (*initialize_adapter)(struct net_device *dev);
Signature · 1 line
2.39.2
PATCH 2/11 staging: rtl8192e: Remove entry .init_adapter_.. from struct rtl819x_ops
In reply to Philipp HortmannRemove entry .init_adapter_variable and replace it with function name rtl92e_init_variables. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +-- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -2
@@ -27,7 +27,6 @@ static char *ifname = "wlan%d";static const struct rtl819x_ops rtl819xp_ops = { .nic_type =NIC_8192E , - .init_adapter_variable = rtl92e_init_variables, .initialize_adapter = rtl92e_start_adapter, .link_change = rtl92e_link_change, .tx_fill_descriptor = rtl92e_fill_tx_desc,
@@ -974,7 +973,7 @@ static short _rtl92e_init(struct net_device *dev)_rtl92e_init_priv_lock (priv);_rtl92e_init_priv_task (dev);rtl92e_get_eeprom_size (dev); - priv->ops->init_adapter_variable (dev); +rtl92e_init_variables (dev);_rtl92e_get_channel_map (dev);rtl92e_dm_init (dev);
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
@@ -205,7 +205,6 @@ struct rtl8192_tx_ring {struct rtl819x_ops {enum nic_t nic_type; -void (*init_adapter_variable)(struct net_device *dev);void (*init_before_adapter_start)(struct net_device *dev);bool (*initialize_adapter)(struct net_device *dev);void (*link_change)(struct net_device *dev);
Signature · 1 line
2.39.2
PATCH 3/11 staging: rtl8192e: Remove entry .initialize_ad.. from struct rtl819x_ops
In reply to Philipp HortmannRemove entry .initialize_adapter and replace it with function name rtl92e_start_adapter. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 5 ++--- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +2 -3
@@ -27,7 +27,6 @@ static char *ifname = "wlan%d";static const struct rtl819x_ops rtl819xp_ops = { .nic_type =NIC_8192E , - .initialize_adapter = rtl92e_start_adapter, .link_change = rtl92e_link_change, .tx_fill_descriptor = rtl92e_fill_tx_desc, .tx_fill_cmd_descriptor = rtl92e_fill_tx_cmd_desc,
@@ -690,7 +689,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) priv->rtllib->ieee_up =1 ; priv->up_first_time =0 ; - init_status = priv->ops->initialize_adapter (dev); + init_status =rtl92e_start_adapter (dev);if (!init_status) {netdev_err (dev,"%s(): Initialization failed!\n" , __func__);return -1 ;
@@ -2381,7 +2380,7 @@ bool rtl92e_enable_nic(struct net_device *dev)return false; } - init_status = priv->ops->initialize_adapter (dev); + init_status =rtl92e_start_adapter (dev);if (!init_status) {netdev_warn (dev,"%s(): Initialization failed!\n" , __func__); priv->bdisable_nic = false;
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
@@ -206,7 +206,6 @@ struct rtl8192_tx_ring {struct rtl819x_ops {enum nic_t nic_type;void (*init_before_adapter_start)(struct net_device *dev); -bool (*initialize_adapter)(struct net_device *dev);void (*link_change)(struct net_device *dev); void (*tx_fill_descriptor)(struct net_device *dev, struct tx_desc *tx_desc,
Signature · 1 line
2.39.2
PATCH 4/11 staging: rtl8192e: Remove entry .tx_fill_descr.. from struct rtl819x_ops
In reply to Philipp HortmannRemove entry .tx_fill_descriptor and replace it with function name rtl92e_fill_tx_desc. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 5 ++--- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +2 -3
@@ -28,7 +28,6 @@ static char *ifname = "wlan%d";static const struct rtl819x_ops rtl819xp_ops = { .nic_type =NIC_8192E , .link_change = rtl92e_link_change, - .tx_fill_descriptor = rtl92e_fill_tx_desc, .tx_fill_cmd_descriptor = rtl92e_fill_tx_cmd_desc, .rx_query_status_descriptor = rtl92e_get_rx_stats, .rx_command_packet_handler =NULL ,
@@ -496,7 +495,7 @@ static void _rtl92e_prepare_beacon(struct tasklet_struct *t)skb_push (pnewskb, priv->rtllib->tx_headroom); pdesc = &ring->desc[0 ]; - priv->ops->tx_fill_descriptor (dev, pdesc, tcb_desc, pnewskb); +rtl92e_fill_tx_desc (dev, pdesc, tcb_desc, pnewskb);__skb_queue_tail (&ring->queue, pnewskb); pdesc->OWN =1 ; }
@@ -1637,7 +1636,7 @@ static short _rtl92e_tx(struct net_device *dev, struct sk_buff *skb)if (priv->rtllib->LedControlHandler) priv->rtllib->LedControlHandler (dev,LED_CTL_TX ); } - priv->ops->tx_fill_descriptor (dev, pdesc, tcb_desc, skb); +rtl92e_fill_tx_desc (dev, pdesc, tcb_desc, skb);__skb_queue_tail (&ring->queue, skb); pdesc->OWN =1 ;spin_unlock_irqrestore (&priv->irq_th_lock, flags);
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -4
@@ -207,10 +207,6 @@ struct rtl819x_ops {enum nic_t nic_type;void (*init_before_adapter_start)(struct net_device *dev);void (*link_change)(struct net_device *dev); -void (*tx_fill_descriptor)(struct net_device *dev, -struct tx_desc *tx_desc, -struct cb_desc *cb_desc, -struct sk_buff *skb); void (*tx_fill_cmd_descriptor)(struct net_device *dev, struct tx_desc_cmd *entry, struct cb_desc *cb_desc,
Signature · 1 line
2.39.2
PATCH 5/11 staging: rtl8192e: Remove entry .tx_fill_cmd_d.. from struct rtl819x_ops
In reply to Philipp HortmannRemove entry .tx_fill_cmd_descriptor and replace it with function name rtl92e_fill_tx_cmd_desc. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +-- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -2
@@ -28,7 +28,6 @@ static char *ifname = "wlan%d";static const struct rtl819x_ops rtl819xp_ops = { .nic_type =NIC_8192E , .link_change = rtl92e_link_change, - .tx_fill_cmd_descriptor = rtl92e_fill_tx_cmd_desc, .rx_query_status_descriptor = rtl92e_get_rx_stats, .rx_command_packet_handler =NULL , .stop_adapter = rtl92e_stop_adapter,
@@ -1577,7 +1576,7 @@ static void _rtl92e_tx_cmd(struct net_device *dev, struct sk_buff *skb) tcb_desc = (struct cb_desc *)(skb->cb +MAX_DEV_ADDR_SIZE ); - priv->ops->tx_fill_cmd_descriptor (dev, entry, tcb_desc, skb); +rtl92e_fill_tx_cmd_desc (dev, entry, tcb_desc, skb);__skb_queue_tail (&ring->queue, skb);spin_unlock_irqrestore (&priv->irq_th_lock, flags);
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -4
@@ -207,10 +207,6 @@ struct rtl819x_ops {enum nic_t nic_type;void (*init_before_adapter_start)(struct net_device *dev);void (*link_change)(struct net_device *dev); -void (*tx_fill_cmd_descriptor)(struct net_device *dev, -struct tx_desc_cmd *entry, -struct cb_desc *cb_desc, -struct sk_buff *skb); bool (*rx_query_status_descriptor)(struct net_device *dev, struct rtllib_rx_stats *stats, struct rx_desc *pdesc,
Signature · 1 line
2.39.2
PATCH 6/11 staging: rtl8192e: Remove entry .rx_query_stat.. from struct rtl819x_ops
In reply to Philipp HortmannRemove entry .rx_query_status_descriptor and replace it with function name rtl92e_get_rx_stats. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 4 +--- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -3
@@ -28,7 +28,6 @@ static char *ifname = "wlan%d";static const struct rtl819x_ops rtl819xp_ops = { .nic_type =NIC_8192E , .link_change = rtl92e_link_change, - .rx_query_status_descriptor = rtl92e_get_rx_stats, .rx_command_packet_handler =NULL , .stop_adapter = rtl92e_stop_adapter, .update_ratr_table = rtl92e_update_ratr_table,
@@ -1885,8 +1884,7 @@ static void _rtl92e_rx_normal(struct net_device *dev)if (pdesc->OWN)return ; -if (!priv->ops->rx_query_status_descriptor (dev, &stats, - pdesc, skb)) +if (!rtl92e_get_rx_stats (dev, &stats, pdesc, skb)) goto done; new_skb =dev_alloc_skb (priv->rxbuffersize);/* if allocation of new skb failed - drop current packet
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -4
@@ -207,10 +207,6 @@ struct rtl819x_ops {enum nic_t nic_type;void (*init_before_adapter_start)(struct net_device *dev);void (*link_change)(struct net_device *dev); -bool (*rx_query_status_descriptor)(struct net_device *dev, -struct rtllib_rx_stats *stats, -struct rx_desc *pdesc, -struct sk_buff *skb);bool (*rx_command_packet_handler)(struct net_device *dev,struct sk_buff *skb,struct rx_desc *pdesc);
Signature · 1 line
2.39.2
PATCH 7/11 staging: rtl8192e: Remove entry .stop_adapter from struct rtl819x_ops
In reply to Philipp HortmannRemove entry .stop_adapter and replace it with function name rtl92e_stop_adapter. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 7 +++---- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - 2 files changed, 3 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +3 -4
@@ -29,7 +29,6 @@ static const struct rtl819x_ops rtl819xp_ops = { .nic_type = NIC_8192E, .link_change = rtl92e_link_change, .rx_command_packet_handler = NULL, - .stop_adapter = rtl92e_stop_adapter, .update_ratr_table = rtl92e_update_ratr_table, .irq_enable = rtl92e_enable_irq, .irq_disable = rtl92e_disable_irq,
@@ -756,7 +755,7 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf) } priv->rf_change_in_progress = true;spin_unlock_irqrestore (&priv->rf_ps_lock, flags); - priv->ops->stop_adapter (dev, false); +rtl92e_stop_adapter (dev, false);spin_lock_irqsave (&priv->rf_ps_lock, flags); priv->rf_change_in_progress = false;spin_unlock_irqrestore (&priv->rf_ps_lock, flags);
@@ -2055,7 +2054,7 @@ void rtl92e_commit(struct net_device *dev)return ;rtllib_softmac_stop_protocol (priv->rtllib,0 , true);rtl92e_irq_disable (dev); - priv->ops->stop_adapter (dev, true); +rtl92e_stop_adapter (dev, true);_rtl92e_up (dev, false); }
@@ -2401,7 +2400,7 @@ bool rtl92e_disable_nic(struct net_device *dev)_rtl92e_cancel_deferred_work (priv);rtl92e_irq_disable (dev); - priv->ops->stop_adapter (dev, false); +rtl92e_stop_adapter (dev, false);return true; }
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
@@ -210,7 +210,6 @@ struct rtl819x_ops {bool (*rx_command_packet_handler)(struct net_device *dev,struct sk_buff *skb,struct rx_desc *pdesc); -void (*stop_adapter)(struct net_device *dev,bool reset);void (*update_ratr_table)(struct net_device *dev);void (*irq_enable)(struct net_device *dev);void (*irq_disable)(struct net_device *dev);
Signature · 1 line
2.39.2
PATCH 8/11 staging: rtl8192e: Remove entry .update_ratr_t.. from struct rtl819x_ops
In reply to Philipp HortmannRemove entry .update_ratr_table and replace it with function name rtl92e_update_ratr_table. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 - drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - 3 files changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +1 -1
@@ -806,7 +806,7 @@ void rtl92e_link_change(struct net_device *dev)if (ieee->state ==RTLLIB_LINKED ) {_rtl92e_net_update (dev); - priv->ops->update_ratr_table (dev); +rtl92e_update_ratr_table (dev);if ((ieee->pairwise_key_type ==KEY_TYPE_WEP40 ) || (ieee->pairwise_key_type ==KEY_TYPE_WEP104 ))rtl92e_enable_hw_security_config (dev);
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -1
@@ -29,7 +29,6 @@ static const struct rtl819x_ops rtl819xp_ops = { .nic_type = NIC_8192E, .link_change = rtl92e_link_change, .rx_command_packet_handler = NULL, - .update_ratr_table = rtl92e_update_ratr_table, .irq_enable = rtl92e_enable_irq, .irq_disable = rtl92e_disable_irq, .irq_clear = rtl92e_clear_irq,
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
@@ -210,7 +210,6 @@ struct rtl819x_ops {bool (*rx_command_packet_handler)(struct net_device *dev,struct sk_buff *skb,struct rx_desc *pdesc); -void (*update_ratr_table)(struct net_device *dev);void (*irq_enable)(struct net_device *dev);void (*irq_disable)(struct net_device *dev);void (*irq_clear)(struct net_device *dev);
Signature · 1 line
2.39.2
PATCH 9/11 staging: rtl8192e: Remove entry .irq_enable from struct rtl819x_ops
In reply to Philipp HortmannRemove entry .irq_enable and replace it with function name rtl92e_enable_irq. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +-- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -2
@@ -29,7 +29,6 @@ static const struct rtl819x_ops rtl819xp_ops = { .nic_type = NIC_8192E, .link_change = rtl92e_link_change, .rx_command_packet_handler = NULL, - .irq_enable = rtl92e_enable_irq, .irq_disable = rtl92e_disable_irq, .irq_clear = rtl92e_clear_irq, .rx_enable = rtl92e_enable_rx,
@@ -247,7 +246,7 @@ void rtl92e_irq_enable(struct net_device *dev) priv->irq_enabled =1 ; - priv->ops->irq_enable (dev); +rtl92e_enable_irq (dev); }void rtl92e_irq_disable (struct net_device *dev)
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
@@ -210,7 +210,6 @@ struct rtl819x_ops {bool (*rx_command_packet_handler)(struct net_device *dev,struct sk_buff *skb,struct rx_desc *pdesc); -void (*irq_enable)(struct net_device *dev);void (*irq_disable)(struct net_device *dev);void (*irq_clear)(struct net_device *dev);void (*rx_enable)(struct net_device *dev);
Signature · 1 line
2.39.2
PATCH 10/11 staging: rtl8192e: Remove entry .irq_disable from struct rtl819x_ops
In reply to Philipp HortmannRemove entry .irq_disable and replace it with function name rtl92e_disable_irq. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +-- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -2
@@ -29,7 +29,6 @@ static const struct rtl819x_ops rtl819xp_ops = { .nic_type = NIC_8192E, .link_change = rtl92e_link_change, .rx_command_packet_handler = NULL, - .irq_disable = rtl92e_disable_irq, .irq_clear = rtl92e_clear_irq, .rx_enable = rtl92e_enable_rx, .tx_enable = rtl92e_enable_tx,
@@ -253,7 +252,7 @@ void rtl92e_irq_disable(struct net_device *dev) {struct r8192_priv *priv =rtllib_priv (dev); - priv->ops->irq_disable (dev); +rtl92e_disable_irq (dev); priv->irq_enabled =0 ; }
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
@@ -210,7 +210,6 @@ struct rtl819x_ops {bool (*rx_command_packet_handler)(struct net_device *dev,struct sk_buff *skb,struct rx_desc *pdesc); -void (*irq_disable)(struct net_device *dev);void (*irq_clear)(struct net_device *dev);void (*rx_enable)(struct net_device *dev);void (*tx_enable)(struct net_device *dev);
Signature · 1 line
2.39.2
PATCH 11/11 staging: rtl8192e: Remove entry .rx_enable from struct rtl819x_ops
In reply to Philipp HortmannRemove entry .rx_enable and replace it with function name rtl92e_enable_rx. This increases readability of the code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 5 +---- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -4
@@ -30,7 +30,6 @@ static const struct rtl819x_ops rtl819xp_ops = { .link_change = rtl92e_link_change, .rx_command_packet_handler = NULL, .irq_clear = rtl92e_clear_irq, - .rx_enable = rtl92e_enable_rx, .tx_enable = rtl92e_enable_tx, .interrupt_recognized = rtl92e_ack_irq, .tx_check_stuck_handler = rtl92e_is_tx_stuck,
@@ -1400,9 +1399,7 @@ static void _rtl92e_watchdog_timer_cb(struct timer_list *t)****************************************************************************/ void rtl92e_rx_enable (struct net_device *dev) { -struct r8192_priv *priv =rtllib_priv (dev); - - priv->ops->rx_enable (dev); +rtl92e_enable_rx (dev); }void rtl92e_tx_enable (struct net_device *dev)
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
@@ -211,7 +211,6 @@ struct rtl819x_ops {struct sk_buff *skb, struct rx_desc *pdesc);void (*irq_clear)(struct net_device *dev); -void (*rx_enable)(struct net_device *dev);void (*tx_enable)(struct net_device *dev);void (*interrupt_recognized)(struct net_device *dev,u32 *p_inta,u32 *p_intb);
Signature · 1 line
2.39.2