Skip to contentSkip to conversation

libertas: remove arbitrary typedefs

PATCH New Holger Schurig 1 participant 1 message Nov 23, 2007 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libertas: remove arbitrary typedefs

[PATCH]: libertas: remove private typedef

New typedefs are usually frowned upon. This patch changes libertas_adapter -> struct libertas_adapter libertas_priv -> struct libertas_priv

While passing, make everything checkpatch.pl-clean that gets touches.

drivers/net/wireless/libertas/11d.c +17 -17
@@ -438,7 +438,7 @@
 
 }
 
-void lbs_init_11d(lbs_private * priv)
+void lbs_init_11d(struct lbs_private *priv)
 {
 	priv->adapter->enable11d = 0;
 	memset(&(priv->adapter->parsed_region_chan), 0,
@@ -448,10 +448,10 @@
 
 /**
  *  @brief This function sets DOMAIN INFO to FW
- *  @param priv       pointer to lbs_private
+ *  @param priv       pointer to struct lbs_private
  *  @return 	      0; -1
 */
-static int set_domain_info_11d(lbs_private * priv)
+static int set_domain_info_11d(struct lbs_private *priv)
 {
 	int ret;
 
@@ -471,13 +471,13 @@
 
 /**
  *  @brief This function setups scan channels
- *  @param priv       pointer to lbs_private
+ *  @param priv       pointer to struct lbs_private
  *  @param band       band
  *  @return 	      0
 */
-int lbs_set_universaltable(lbs_private * priv, u8 band)
+int lbs_set_universaltable(struct lbs_private *priv, u8 band)
 {
-	lbs_adapter *adapter = priv->adapter;
+	struct lbs_adapter *adapter = priv->adapter;
 	u16 size = sizeof(struct chan_freq_power);
 	u16 i = 0;
 
@@ -500,20 +500,20 @@
 
 /**
  *  @brief This function implements command CMD_802_11D_DOMAIN_INFO
- *  @param priv       pointer to lbs_private
+ *  @param priv       pointer to struct lbs_private
  *  @param cmd        pointer to cmd buffer
  *  @param cmdno      cmd ID
  *  @param cmdOption  cmd action
  *  @return 	      0
 */
-int lbs_cmd_802_11d_domain_info(lbs_private * priv,
+int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
 				 struct cmd_ds_command *cmd, u16 cmdno,
 				 u16 cmdoption)
 {
 	struct cmd_ds_802_11d_domain_info *pdomaininfo =
 	    &cmd->params.domaininfo;
 	struct mrvlietypes_domainparamset *domain = &pdomaininfo->domain;
-	lbs_adapter *adapter = priv->adapter;
+	struct lbs_adapter *adapter = priv->adapter;
 	u8 nr_subband = adapter->domainreg.nr_subband;
 
 	lbs_deb_enter(LBS_DEB_11D);
@@ -560,11 +560,11 @@
 
 /**
  *  @brief This function parses countryinfo from AP and download country info to FW
- *  @param priv    pointer to lbs_private
+ *  @param priv    pointer to struct lbs_private
  *  @param resp    pointer to command response buffer
  *  @return 	   0; -1
  */
-int lbs_ret_802_11d_domain_info(lbs_private * priv,
+int lbs_ret_802_11d_domain_info(struct lbs_private *priv,
 				 struct cmd_ds_command *resp)
 {
 	struct cmd_ds_802_11d_domain_info *domaininfo = &resp->params.domaininforesp;
@@ -606,14 +606,14 @@
 
 /**
  *  @brief This function parses countryinfo from AP and download country info to FW
- *  @param priv    pointer to lbs_private
+ *  @param priv    pointer to struct lbs_private
  *  @return 	   0; -1
  */
-int lbs_parse_dnld_countryinfo_11d(lbs_private * priv,
+int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
                                         struct bss_descriptor * bss)
 {
 	int ret;
-	lbs_adapter *adapter = priv->adapter;
+	struct lbs_adapter *adapter = priv->adapter;
 
 	lbs_deb_enter(LBS_DEB_11D);
 	if (priv->adapter->enable11d) {
@@ -648,13 +648,13 @@
 
 /**
  *  @brief This function generates 11D info from user specified regioncode and download to FW
- *  @param priv    pointer to lbs_private
+ *  @param priv    pointer to struct lbs_private
  *  @return 	   0; -1
  */
-int lbs_create_dnld_countryinfo_11d(lbs_private * priv)
+int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv)
 {
 	int ret;
-	lbs_adapter *adapter = priv->adapter;
+	struct lbs_adapter *adapter = priv->adapter;
 	struct region_channel *region_chan;
 	u8 j;
 
drivers/net/wireless/libertas/11d.h +8 -6
@@ -78,26 +78,28 @@
 	u8 code;
 };
 
+struct lbs_private;
+
 u8 lbs_get_scan_type_11d(u8 chan,
 			  struct parsed_region_chan_11d *parsed_region_chan);
 
 u32 lbs_chan_2_freq(u8 chan, u8 band);
 
-void lbs_init_11d(lbs_private * priv);
+void lbs_init_11d(struct lbs_private *priv);
 
-int lbs_set_universaltable(lbs_private * priv, u8 band);
+int lbs_set_universaltable(struct lbs_private *priv, u8 band);
 
-int lbs_cmd_802_11d_domain_info(lbs_private * priv,
+int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
 				 struct cmd_ds_command *cmd, u16 cmdno,
 				 u16 cmdOption);
 
-int lbs_ret_802_11d_domain_info(lbs_private * priv,
+int lbs_ret_802_11d_domain_info(struct lbs_private *priv,
 				 struct cmd_ds_command *resp);
 
 struct bss_descriptor;
-int lbs_parse_dnld_countryinfo_11d(lbs_private * priv,
+int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
                                         struct bss_descriptor * bss);
 
-int lbs_create_dnld_countryinfo_11d(lbs_private * priv);
+int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv);
 
 #endif
drivers/net/wireless/libertas/assoc.c +25 -23

152 lines not on this page · raw message

drivers/net/wireless/libertas/assoc.h +1 -1
@@ -6,7 +6,7 @@
 #include "dev.h"
 
 void lbs_association_worker(struct work_struct *work);
-struct assoc_request *lbs_get_association_request(lbs_adapter *adapter);
+struct assoc_request *lbs_get_association_request(struct lbs_adapter *adapter);
 void lbs_sync_channel(struct work_struct *work);
 
 #endif
drivers/net/wireless/libertas/cmd.c +74 -70

495 lines not on this page · raw message

drivers/net/wireless/libertas/cmdresp.c +40 -40

260 lines not on this page · raw message

drivers/net/wireless/libertas/debugfs.c +54 -54

322 lines not on this page · raw message

drivers/net/wireless/libertas/debugfs.h +2 -2
@@ -4,7 +4,7 @@
 void lbs_debugfs_init(void);
 void lbs_debugfs_remove(void);
 
-void lbs_debugfs_init_one(lbs_private *priv, struct net_device *dev);
-void lbs_debugfs_remove_one(lbs_private *priv);
+void lbs_debugfs_init_one(struct lbs_private *priv, struct net_device *dev);
+void lbs_debugfs_remove_one(struct lbs_private *priv);
 
 #endif
drivers/net/wireless/libertas/decl.h +48 -40

119 lines not on this page · raw message

drivers/net/wireless/libertas/defs.h +0 -2
@@ -262,8 +262,6 @@
 #define UNSET_MESH_FRAME(x) (x->cb[6]=0)
 
 /** Global Variable Declaration */
-typedef struct _lbs_private lbs_private;
-typedef struct _lbs_adapter lbs_adapter;
 extern const char lbs_driver_version[];
 extern u16 lbs_region_code_to_index[MRVDRV_MAX_REGION_CODE];
 
drivers/net/wireless/libertas/dev.h +7 -7
@@ -1,7 +1,7 @@
 /**
   * This file contains definitions and data structures specific
   * to Marvell 802.11 NIC. It contains the Device Information
-  * structure lbs_adapter.
+  * structure struct lbs_adapter.
   */
 #ifndef _LBS_DEV_H_
 #define _LBS_DEV_H_
@@ -99,7 +99,7 @@
 };
 
 /** Private structure for the MV device */
-struct _lbs_private {
+struct lbs_private {
 	int open;
 	int mesh_open;
 	int infra_open;
@@ -109,7 +109,7 @@
 	char name[DEV_NAME_LEN];
 
 	void *card;
-	lbs_adapter *adapter;
+	struct lbs_adapter *adapter;
 	struct net_device *dev;
 
 	struct net_device_stats stats;
@@ -155,9 +155,9 @@
 	struct work_struct sync_channel;
 
 	/** Hardware access */
-	int (*hw_host_to_card) (lbs_private *priv, u8 type, u8 *payload, u16 nb);
-	int (*hw_get_int_status) (lbs_private *priv, u8 *);
-	int (*hw_read_event_cause) (lbs_private *);
+	int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb);
+	int (*hw_get_int_status) (struct lbs_private *priv, u8 *);
+	int (*hw_read_event_cause) (struct lbs_private *);
 };
 
 /** Association request
@@ -205,7 +205,7 @@
 };
 
 /** Wlan adapter data structure*/
-struct _lbs_adapter {
+struct lbs_adapter {
 	/** STATUS variables */
 	u8 fwreleasenumber[4];
 	u32 fwcapinfo;
drivers/net/wireless/libertas/ethtool.c +4 -4
@@ -22,7 +22,7 @@
 static void lbs_ethtool_get_drvinfo(struct net_device *dev,
 					 struct ethtool_drvinfo *info)
 {
-	lbs_private *priv = (lbs_private *) dev->priv;
+	struct lbs_private *priv = (struct lbs_private *) dev->priv;
 	char fwver[32];
 
 	lbs_get_fwversion(priv->adapter, fwver, sizeof(fwver) - 1);
@@ -45,8 +45,8 @@
 static int lbs_ethtool_get_eeprom(struct net_device *dev,
                                   struct ethtool_eeprom *eeprom, u8 * bytes)
 {
-	lbs_private *priv = (lbs_private *) dev->priv;
-	lbs_adapter *adapter = priv->adapter;
+	struct lbs_private *priv = (struct lbs_private *) dev->priv;
+	struct lbs_adapter *adapter = priv->adapter;
 	struct lbs_ioctl_regrdwr regctrl;
 	char *ptr;
 	int ret;
@@ -108,7 +108,7 @@
 static void lbs_ethtool_get_stats(struct net_device * dev,
 				struct ethtool_stats * stats, u64 * data)
 {
-	lbs_private *priv = dev->priv;
+	struct lbs_private *priv = dev->priv;
 	struct cmd_ds_mesh_access mesh_access;
 	int ret;
 
drivers/net/wireless/libertas/if_cs.c +13 -10
@@ -57,7 +57,7 @@
 
 struct if_cs_card {
 	struct pcmcia_device *p_dev;
-	lbs_private *priv;
+	struct lbs_private *priv;
 	void __iomem *iobase;
 };
 
@@ -285,7 +285,7 @@
 /*
  * Called from if_cs_host_to_card to send a command to the hardware
  */
-static int if_cs_send_cmd(lbs_private *priv, u8 *buf, u16 nb)
+static int if_cs_send_cmd(struct lbs_private *priv, u8 *buf, u16 nb)
 {
 	struct if_cs_card *card = (struct if_cs_card *)priv->card;
 	int ret = -1;
@@ -330,7 +330,7 @@
 /*
  * Called from if_cs_host_to_card to send a data to the hardware
  */
-static void if_cs_send_data(lbs_private *priv, u8 *buf, u16 nb)
+static void if_cs_send_data(struct lbs_private *priv, u8 *buf, u16 nb)
 {
 	struct if_cs_card *card = (struct if_cs_card *)priv->card;
 
@@ -353,7 +353,7 @@
 /*
  * Get the command result out of the card.
  */
-static int if_cs_receive_cmdres(lbs_private *priv, u8 *data, u32 *len)
+static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len)
 {
 	int ret = -1;
 	u16 val;
@@ -385,7 +385,7 @@
 }
 
 
-static struct sk_buff *if_cs_receive_data(lbs_private *priv)
+static struct sk_buff *if_cs_receive_data(struct lbs_private *priv)
 {
 	struct sk_buff *skb = NULL;
 	u16 len;
@@ -615,7 +615,10 @@
 /********************************************************************/
 
 /* Send commands or data packets to the card */
-static int if_cs_host_to_card(lbs_private *priv, u8 type, u8 *buf, u16 nb)
+static int if_cs_host_to_card(struct lbs_private *priv,
+	u8 type,
+	u8 *buf,
+	u16 nb)
 {
 	int ret = -1;
 
@@ -640,10 +643,10 @@
 }
 
 
-static int if_cs_get_int_status(lbs_private *priv, u8 *ireg)
+static int if_cs_get_int_status(struct lbs_private *priv, u8 *ireg)
 {
 	struct if_cs_card *card = (struct if_cs_card *)priv->card;
-	/* lbs_adapter *adapter = priv->adapter; */
+	/* struct lbs_adapter *adapter = priv->adapter; */
 	int ret = 0;
 	u16 int_cause;
 	u8 *cmdbuf;
@@ -697,7 +700,7 @@
 }
 
 
-static int if_cs_read_event_cause(lbs_private *priv)
+static int if_cs_read_event_cause(struct lbs_private *priv)
 {
 	lbs_deb_enter(LBS_DEB_CS);
 
@@ -745,7 +748,7 @@
 static int if_cs_probe(struct pcmcia_device *p_dev)
 {
 	int ret = -ENOMEM;
-	lbs_private *priv;
+	struct lbs_private *priv;
 	struct if_cs_card *card;
 	/* CIS parsing */
 	tuple_t tuple;
drivers/net/wireless/libertas/if_usb.c +26 -20

153 lines not on this page · raw message

drivers/net/wireless/libertas/join.c +36 -32

206 lines not on this page · raw message

drivers/net/wireless/libertas/join.h +15 -15
@@ -12,41 +12,41 @@
 #include "dev.h"
 
 struct cmd_ds_command;
-int lbs_cmd_80211_authenticate(lbs_private *priv,
+int lbs_cmd_80211_authenticate(struct lbs_private *priv,
 					struct cmd_ds_command *cmd,
 					void *pdata_buf);
-int lbs_cmd_80211_ad_hoc_join(lbs_private *priv,
+int lbs_cmd_80211_ad_hoc_join(struct lbs_private *priv,
 				       struct cmd_ds_command *cmd,
 				       void *pdata_buf);
-int lbs_cmd_80211_ad_hoc_stop(lbs_private *priv,
+int lbs_cmd_80211_ad_hoc_stop(struct lbs_private *priv,
 				       struct cmd_ds_command *cmd);
-int lbs_cmd_80211_ad_hoc_start(lbs_private *priv,
+int lbs_cmd_80211_ad_hoc_start(struct lbs_private *priv,
 					struct cmd_ds_command *cmd,
 					void *pdata_buf);
-int lbs_cmd_80211_deauthenticate(lbs_private *priv,
+int lbs_cmd_80211_deauthenticate(struct lbs_private *priv,
 					  struct cmd_ds_command *cmd);
-int lbs_cmd_80211_associate(lbs_private *priv,
+int lbs_cmd_80211_associate(struct lbs_private *priv,
 				     struct cmd_ds_command *cmd,
 				     void *pdata_buf);
 
-int lbs_ret_80211_ad_hoc_start(lbs_private *priv,
+int lbs_ret_80211_ad_hoc_start(struct lbs_private *priv,
 					struct cmd_ds_command *resp);
-int lbs_ret_80211_ad_hoc_stop(lbs_private *priv,
+int lbs_ret_80211_ad_hoc_stop(struct lbs_private *priv,
 				       struct cmd_ds_command *resp);
-int lbs_ret_80211_disassociate(lbs_private *priv,
+int lbs_ret_80211_disassociate(struct lbs_private *priv,
 					struct cmd_ds_command *resp);
-int lbs_ret_80211_associate(lbs_private *priv,
+int lbs_ret_80211_associate(struct lbs_private *priv,
 				     struct cmd_ds_command *resp);
 
-int lbs_start_adhoc_network(lbs_private *priv,
+int lbs_start_adhoc_network(struct lbs_private *priv,
 			     struct assoc_request * assoc_req);
-int lbs_join_adhoc_network(lbs_private *priv,
+int lbs_join_adhoc_network(struct lbs_private *priv,
 				struct assoc_request * assoc_req);
-int lbs_stop_adhoc_network(lbs_private *priv);
+int lbs_stop_adhoc_network(struct lbs_private *priv);
 
-int lbs_send_deauthentication(lbs_private *priv);
+int lbs_send_deauthentication(struct lbs_private *priv);
 
-int lbs_associate(lbs_private *priv, struct assoc_request *assoc_req);
+int lbs_associate(struct lbs_private *priv, struct assoc_request *assoc_req);
 
 void lbs_unset_basic_rate_flags(u8 *rates, size_t len);
 
drivers/net/wireless/libertas/main.c +63 -59

362 lines not on this page · raw message

drivers/net/wireless/libertas/rx.c +22 -20

114 lines not on this page · raw message

drivers/net/wireless/libertas/scan.c +41 -38

259 lines not on this page · raw message

drivers/net/wireless/libertas/scan.h +9 -7
@@ -10,6 +10,8 @@
 #include <net/ieee80211.h>
 #include "hostcmd.h"
 
+struct lbs_adapter;
+
 /**
  *  @brief Maximum number of channels that can be sent in a setuserscan ioctl
  *
@@ -176,27 +178,27 @@
 
 int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
 
-struct bss_descriptor *lbs_find_ssid_in_list(lbs_adapter *adapter,
+struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_adapter *adapter,
 		u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode,
 		int channel);
 
-struct bss_descriptor *lbs_find_bssid_in_list(lbs_adapter *adapter,
+struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_adapter *adapter,
 	u8 *bssid, u8 mode);
 
-int lbs_find_best_network_ssid(lbs_private *priv, u8 *out_ssid,
+int lbs_find_best_network_ssid(struct lbs_private *priv, u8 *out_ssid,
 			u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
 
-int lbs_send_specific_ssid_scan(lbs_private *priv, u8 *ssid,
+int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
 				u8 ssid_len, u8 clear_ssid);
 
-int lbs_cmd_80211_scan(lbs_private *priv,
+int lbs_cmd_80211_scan(struct lbs_private *priv,
 				struct cmd_ds_command *cmd,
 				void *pdata_buf);
 
-int lbs_ret_80211_scan(lbs_private *priv,
+int lbs_ret_80211_scan(struct lbs_private *priv,
 				struct cmd_ds_command *resp);
 
-int lbs_scan_networks(lbs_private *priv,
+int lbs_scan_networks(struct lbs_private *priv,
 	const struct lbs_ioctl_user_scan_cfg *puserscanin,
                 int full_scan);
 
drivers/net/wireless/libertas/tx.c +11 -11
@@ -52,11 +52,11 @@
  *  @brief This function processes a single packet and sends
  *  to IF layer
  *
- *  @param priv    A pointer to lbs_private structure
+ *  @param priv    A pointer to struct lbs_private structure
  *  @param skb     A pointer to skb which includes TX packet
  *  @return 	   0 or -1
  */
-static int SendSinglePacket(lbs_private *priv, struct sk_buff *skb)
+static int SendSinglePacket(struct lbs_private *priv, struct sk_buff *skb)
 {
 	int ret = 0;
 	struct txpd localtxpd;
@@ -164,9 +164,9 @@
 }
 
 
-void lbs_tx_runqueue(lbs_private *priv)
+void lbs_tx_runqueue(struct lbs_private *priv)
 {
-	lbs_adapter *adapter = priv->adapter;
+	struct lbs_adapter *adapter = priv->adapter;
 	int i;
 
 	spin_lock(&adapter->txqueue_lock);
@@ -180,9 +180,9 @@
 	spin_unlock(&adapter->txqueue_lock);
 }
 
-static void lbs_tx_queue(lbs_private *priv, struct sk_buff *skb)
+static void lbs_tx_queue(struct lbs_private *priv, struct sk_buff *skb)
 {
-	lbs_adapter *adapter = priv->adapter;
+	struct lbs_adapter *adapter = priv->adapter;
 
 	spin_lock(&adapter->txqueue_lock);
 
@@ -205,10 +205,10 @@
  *  @brief This function checks the conditions and sends packet to IF
  *  layer if everything is ok.
  *
- *  @param priv    A pointer to lbs_private structure
+ *  @param priv    A pointer to struct lbs_private structure
  *  @return 	   n/a
  */
-int lbs_process_tx(lbs_private *priv, struct sk_buff *skb)
+int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)
 {
 	int ret = -1;
 
@@ -239,14 +239,14 @@
  *  @brief This function sends to the host the last transmitted packet,
  *  filling the radiotap headers with transmission information.
  *
- *  @param priv     A pointer to lbs_private structure
+ *  @param priv     A pointer to struct lbs_private structure
  *  @param status   A 32 bit value containing transmission status.
  *
  *  @returns void
  */
-void lbs_send_tx_feedback(lbs_private *priv)
+void lbs_send_tx_feedback(struct lbs_private *priv)
 {
-	lbs_adapter *adapter = priv->adapter;
+	struct lbs_adapter *adapter = priv->adapter;
 	struct tx_radiotap_hdr *radiotap_hdr;
 	u32 status = adapter->eventcause;
 	int txfail;
drivers/net/wireless/libertas/wext.c +84 -80

83 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.