diff options
Diffstat (limited to 'drivers/net/wireless/libertas/mesh.c')
| -rw-r--r-- | drivers/net/wireless/libertas/mesh.c | 218 | 
1 files changed, 146 insertions, 72 deletions
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c index 9d097b9c800..24cf06680c6 100644 --- a/drivers/net/wireless/libertas/mesh.c +++ b/drivers/net/wireless/libertas/mesh.c @@ -1,3 +1,5 @@ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +  #include <linux/delay.h>  #include <linux/etherdevice.h>  #include <linux/netdevice.h> @@ -16,12 +18,15 @@   * Mesh sysfs support   */ -/** +/*   * Attributes exported through sysfs   */  /** - * @brief Get function for sysfs attribute anycast_mask + * lbs_anycast_get - Get function for sysfs attribute anycast_mask + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer where data will be returned   */  static ssize_t lbs_anycast_get(struct device *dev,  		struct device_attribute *attr, char * buf) @@ -40,7 +45,11 @@ static ssize_t lbs_anycast_get(struct device *dev,  }  /** - * @brief Set function for sysfs attribute anycast_mask + * lbs_anycast_set - Set function for sysfs attribute anycast_mask + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer that contains new attribute value + * @count: size of buffer   */  static ssize_t lbs_anycast_set(struct device *dev,  		struct device_attribute *attr, const char * buf, size_t count) @@ -62,7 +71,10 @@ static ssize_t lbs_anycast_set(struct device *dev,  }  /** - * @brief Get function for sysfs attribute prb_rsp_limit + * lbs_prb_rsp_limit_get - Get function for sysfs attribute prb_rsp_limit + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer where data will be returned   */  static ssize_t lbs_prb_rsp_limit_get(struct device *dev,  		struct device_attribute *attr, char *buf) @@ -85,7 +97,11 @@ static ssize_t lbs_prb_rsp_limit_get(struct device *dev,  }  /** - * @brief Set function for sysfs attribute prb_rsp_limit + * lbs_prb_rsp_limit_set - Set function for sysfs attribute prb_rsp_limit + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer that contains new attribute value + * @count: size of buffer   */  static ssize_t lbs_prb_rsp_limit_set(struct device *dev,  		struct device_attribute *attr, const char *buf, size_t count) @@ -114,7 +130,10 @@ static ssize_t lbs_prb_rsp_limit_set(struct device *dev,  }  /** - * Get function for sysfs attribute mesh + * lbs_mesh_get - Get function for sysfs attribute mesh + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer where data will be returned   */  static ssize_t lbs_mesh_get(struct device *dev,  		struct device_attribute *attr, char * buf) @@ -124,7 +143,11 @@ static ssize_t lbs_mesh_get(struct device *dev,  }  /** - *  Set function for sysfs attribute mesh + * lbs_mesh_set - Set function for sysfs attribute mesh + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer that contains new attribute value + * @count: size of buffer   */  static ssize_t lbs_mesh_set(struct device *dev,  		struct device_attribute *attr, const char * buf, size_t count) @@ -151,19 +174,19 @@ static ssize_t lbs_mesh_set(struct device *dev,  	return count;  } -/** +/*   * lbs_mesh attribute to be exported per ethX interface   * through sysfs (/sys/class/net/ethX/lbs_mesh)   */  static DEVICE_ATTR(lbs_mesh, 0644, lbs_mesh_get, lbs_mesh_set); -/** +/*   * anycast_mask attribute to be exported per mshX interface   * through sysfs (/sys/class/net/mshX/anycast_mask)   */  static DEVICE_ATTR(anycast_mask, 0644, lbs_anycast_get, lbs_anycast_set); -/** +/*   * prb_rsp_limit attribute to be exported per mshX interface   * through sysfs (/sys/class/net/mshX/prb_rsp_limit)   */ @@ -246,7 +269,7 @@ int lbs_init_mesh(struct lbs_private *priv)  		lbs_add_mesh(priv);  		if (device_create_file(&dev->dev, &dev_attr_lbs_mesh)) -			lbs_pr_err("cannot register lbs_mesh attribute\n"); +			netdev_err(dev, "cannot register lbs_mesh attribute\n");  		ret = 1;  	} @@ -274,10 +297,10 @@ int lbs_deinit_mesh(struct lbs_private *priv)  /** - *  @brief This function closes the mshX interface + * lbs_mesh_stop - close the mshX interface   * - *  @param dev     A pointer to net_device structure - *  @return 	   0 + * @dev:	A pointer to &net_device structure + * returns:	0   */  static int lbs_mesh_stop(struct net_device *dev)  { @@ -301,10 +324,10 @@ static int lbs_mesh_stop(struct net_device *dev)  }  /** - *  @brief This function opens the mshX interface + * lbs_mesh_dev_open - open the mshX interface   * - *  @param dev     A pointer to net_device structure - *  @return 	   0 or -EBUSY if monitor mode active + * @dev:	A pointer to &net_device structure + * returns:	0 or -EBUSY if monitor mode active   */  static int lbs_mesh_dev_open(struct net_device *dev)  { @@ -342,10 +365,10 @@ static const struct net_device_ops mesh_netdev_ops = {  };  /** - * @brief This function adds mshX interface + * lbs_add_mesh - add mshX interface   * - *  @param priv    A pointer to the struct lbs_private structure - *  @return 	   0 if successful, -X otherwise + * @priv:	A pointer to the &struct lbs_private structure + * returns:	0 if successful, -X otherwise   */  int lbs_add_mesh(struct lbs_private *priv)  { @@ -374,7 +397,7 @@ int lbs_add_mesh(struct lbs_private *priv)  	/* Register virtual mesh interface */  	ret = register_netdev(mesh_dev);  	if (ret) { -		lbs_pr_err("cannot register mshX virtual interface\n"); +		pr_err("cannot register mshX virtual interface\n");  		goto err_free;  	} @@ -456,13 +479,13 @@ void lbs_mesh_set_txpd(struct lbs_private *priv,   */  /** - *  @brief Add or delete Mesh Blinding Table entries + * lbs_mesh_bt_add_del - Add or delete Mesh Blinding Table entries   * - *  @param priv    	A pointer to struct lbs_private structure - *  @param add  	TRUE to add the entry, FALSE to delete it - *  @param addr1        Destination address to blind or unblind + * @priv:	A pointer to &struct lbs_private structure + * @add:	TRUE to add the entry, FALSE to delete it + * @addr1:	Destination address to blind or unblind   * - *  @return 	   	0 on success, error on failure + * returns:	0 on success, error on failure   */  int lbs_mesh_bt_add_del(struct lbs_private *priv, bool add, u8 *addr1)  { @@ -493,11 +516,11 @@ int lbs_mesh_bt_add_del(struct lbs_private *priv, bool add, u8 *addr1)  }  /** - *  @brief Reset/clear the mesh blinding table + * lbs_mesh_bt_reset - Reset/clear the mesh blinding table   * - *  @param priv    	A pointer to struct lbs_private structure + * @priv:	A pointer to &struct lbs_private structure   * - *  @return 	   	0 on success, error on failure + * returns:	0 on success, error on failure   */  int lbs_mesh_bt_reset(struct lbs_private *priv)  { @@ -517,17 +540,18 @@ int lbs_mesh_bt_reset(struct lbs_private *priv)  }  /** - *  @brief Gets the inverted status of the mesh blinding table + * lbs_mesh_bt_get_inverted - Gets the inverted status of the mesh + * blinding table   * - *  Normally the firmware "blinds" or ignores traffic from mesh nodes in the - *  table, but an inverted table allows *only* traffic from nodes listed in - *  the table. + * Normally the firmware "blinds" or ignores traffic from mesh nodes in the + * table, but an inverted table allows *only* traffic from nodes listed in + * the table.   * - *  @param priv    	A pointer to struct lbs_private structure - *  @param invert  	On success, TRUE if the blinding table is inverted, - *                        FALSE if it is not inverted + * @priv:	A pointer to &struct lbs_private structure + * @inverted:  	On success, TRUE if the blinding table is inverted, + *		FALSE if it is not inverted   * - *  @return 	   	0 on success, error on failure + * returns:	0 on success, error on failure   */  int lbs_mesh_bt_get_inverted(struct lbs_private *priv, bool *inverted)  { @@ -551,18 +575,19 @@ int lbs_mesh_bt_get_inverted(struct lbs_private *priv, bool *inverted)  }  /** - *  @brief Sets the inverted status of the mesh blinding table + * lbs_mesh_bt_set_inverted - Sets the inverted status of the mesh + * blinding table   * - *  Normally the firmware "blinds" or ignores traffic from mesh nodes in the - *  table, but an inverted table allows *only* traffic from nodes listed in - *  the table. + * Normally the firmware "blinds" or ignores traffic from mesh nodes in the + * table, but an inverted table allows *only* traffic from nodes listed in + * the table.   * - *  @param priv    	A pointer to struct lbs_private structure - *  @param invert  	TRUE to invert the blinding table (only traffic from - *                         listed nodes allowed), FALSE to return it - *                         to normal state (listed nodes ignored) + * @priv:	A pointer to &struct lbs_private structure + * @inverted:	TRUE to invert the blinding table (only traffic from + *		listed nodes allowed), FALSE to return it + *		to normal state (listed nodes ignored)   * - *  @return 	   	0 on success, error on failure + * returns:	0 on success, error on failure   */  int lbs_mesh_bt_set_inverted(struct lbs_private *priv, bool inverted)  { @@ -583,13 +608,13 @@ int lbs_mesh_bt_set_inverted(struct lbs_private *priv, bool inverted)  }  /** - *  @brief List an entry in the mesh blinding table + * lbs_mesh_bt_get_entry - List an entry in the mesh blinding table   * - *  @param priv    	A pointer to struct lbs_private structure - *  @param id		The ID of the entry to list - *  @param addr1	MAC address associated with the table entry + * @priv:	A pointer to &struct lbs_private structure + * @id:		The ID of the entry to list + * @addr1:	MAC address associated with the table entry   * - *  @return 	   	0 on success, error on failure + * returns: 	   	0 on success, error on failure   */  int lbs_mesh_bt_get_entry(struct lbs_private *priv, u32 id, u8 *addr1)  { @@ -614,14 +639,14 @@ int lbs_mesh_bt_get_entry(struct lbs_private *priv, u32 id, u8 *addr1)  }  /** - *  @brief Access the mesh forwarding table + * lbs_cmd_fwt_access - Access the mesh forwarding table   * - *  @param priv    	A pointer to struct lbs_private structure - *  @param cmd_action	The forwarding table action to perform - *  @param cmd		The pre-filled FWT_ACCESS command + * @priv:	A pointer to &struct lbs_private structure + * @cmd_action:	The forwarding table action to perform + * @cmd:	The pre-filled FWT_ACCESS command   * - *  @return 	   	0 on success and 'cmd' will be filled with the - *                        firmware's response + * returns:	0 on success and 'cmd' will be filled with the + *		firmware's response   */  int lbs_cmd_fwt_access(struct lbs_private *priv, u16 cmd_action,  			struct cmd_ds_fwt_access *cmd) @@ -774,7 +799,10 @@ static int mesh_get_default_parameters(struct device *dev,  }  /** - * @brief Get function for sysfs attribute bootflag + * bootflag_get - Get function for sysfs attribute bootflag + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer where data will be returned   */  static ssize_t bootflag_get(struct device *dev,  			    struct device_attribute *attr, char *buf) @@ -791,7 +819,11 @@ static ssize_t bootflag_get(struct device *dev,  }  /** - * @brief Set function for sysfs attribute bootflag + * bootflag_set - Set function for sysfs attribute bootflag + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer that contains new attribute value + * @count: size of buffer   */  static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr,  			    const char *buf, size_t count) @@ -817,7 +849,10 @@ static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr,  }  /** - * @brief Get function for sysfs attribute boottime + * boottime_get - Get function for sysfs attribute boottime + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer where data will be returned   */  static ssize_t boottime_get(struct device *dev,  			    struct device_attribute *attr, char *buf) @@ -834,7 +869,11 @@ static ssize_t boottime_get(struct device *dev,  }  /** - * @brief Set function for sysfs attribute boottime + * boottime_set - Set function for sysfs attribute boottime + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer that contains new attribute value + * @count: size of buffer   */  static ssize_t boottime_set(struct device *dev,  		struct device_attribute *attr, const char *buf, size_t count) @@ -869,7 +908,10 @@ static ssize_t boottime_set(struct device *dev,  }  /** - * @brief Get function for sysfs attribute channel + * channel_get - Get function for sysfs attribute channel + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer where data will be returned   */  static ssize_t channel_get(struct device *dev,  			   struct device_attribute *attr, char *buf) @@ -886,7 +928,11 @@ static ssize_t channel_get(struct device *dev,  }  /** - * @brief Set function for sysfs attribute channel + * channel_set - Set function for sysfs attribute channel + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer that contains new attribute value + * @count: size of buffer   */  static ssize_t channel_set(struct device *dev, struct device_attribute *attr,  			   const char *buf, size_t count) @@ -912,7 +958,10 @@ static ssize_t channel_set(struct device *dev, struct device_attribute *attr,  }  /** - * @brief Get function for sysfs attribute mesh_id + * mesh_id_get - Get function for sysfs attribute mesh_id + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer where data will be returned   */  static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,  			   char *buf) @@ -926,7 +975,7 @@ static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,  		return ret;  	if (defs.meshie.val.mesh_id_len > IEEE80211_MAX_SSID_LEN) { -		lbs_pr_err("inconsistent mesh ID length"); +		dev_err(dev, "inconsistent mesh ID length\n");  		defs.meshie.val.mesh_id_len = IEEE80211_MAX_SSID_LEN;  	} @@ -938,7 +987,11 @@ static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,  }  /** - * @brief Set function for sysfs attribute mesh_id + * mesh_id_set - Set function for sysfs attribute mesh_id + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer that contains new attribute value + * @count: size of buffer   */  static ssize_t mesh_id_set(struct device *dev, struct device_attribute *attr,  			   const char *buf, size_t count) @@ -980,7 +1033,10 @@ static ssize_t mesh_id_set(struct device *dev, struct device_attribute *attr,  }  /** - * @brief Get function for sysfs attribute protocol_id + * protocol_id_get - Get function for sysfs attribute protocol_id + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer where data will be returned   */  static ssize_t protocol_id_get(struct device *dev,  			       struct device_attribute *attr, char *buf) @@ -997,7 +1053,11 @@ static ssize_t protocol_id_get(struct device *dev,  }  /** - * @brief Set function for sysfs attribute protocol_id + * protocol_id_set - Set function for sysfs attribute protocol_id + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer that contains new attribute value + * @count: size of buffer   */  static ssize_t protocol_id_set(struct device *dev,  		struct device_attribute *attr, const char *buf, size_t count) @@ -1034,7 +1094,10 @@ static ssize_t protocol_id_set(struct device *dev,  }  /** - * @brief Get function for sysfs attribute metric_id + * metric_id_get - Get function for sysfs attribute metric_id + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer where data will be returned   */  static ssize_t metric_id_get(struct device *dev,  		struct device_attribute *attr, char *buf) @@ -1051,7 +1114,11 @@ static ssize_t metric_id_get(struct device *dev,  }  /** - * @brief Set function for sysfs attribute metric_id + * metric_id_set - Set function for sysfs attribute metric_id + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer that contains new attribute value + * @count: size of buffer   */  static ssize_t metric_id_set(struct device *dev, struct device_attribute *attr,  			     const char *buf, size_t count) @@ -1088,7 +1155,10 @@ static ssize_t metric_id_set(struct device *dev, struct device_attribute *attr,  }  /** - * @brief Get function for sysfs attribute capability + * capability_get - Get function for sysfs attribute capability + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer where data will be returned   */  static ssize_t capability_get(struct device *dev,  		struct device_attribute *attr, char *buf) @@ -1105,7 +1175,11 @@ static ssize_t capability_get(struct device *dev,  }  /** - * @brief Set function for sysfs attribute capability + * capability_set - Set function for sysfs attribute capability + * @dev: the &struct device + * @attr: device attributes + * @buf: buffer that contains new attribute value + * @count: size of buffer   */  static ssize_t capability_set(struct device *dev, struct device_attribute *attr,  			      const char *buf, size_t count)  |