|
@@ -16,12 +16,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 +43,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 +69,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 +95,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 +128,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 +141,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 +172,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)
|
|
|
*/
|
|
@@ -274,10 +295,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 +322,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 +363,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)
|
|
|
{
|
|
@@ -456,13 +477,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 +514,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 +538,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 +573,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 +606,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 +637,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 +797,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 +817,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 +847,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 +867,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 +906,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 +926,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 +956,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)
|
|
@@ -938,7 +985,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 +1031,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 +1051,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 +1092,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 +1112,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 +1153,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 +1173,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)
|