aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/mesh.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-05 17:09:28 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-05 17:09:28 -0400
commit90864fbc7639d7a2300c67a18c9fb9fbcf7d51d2 (patch)
tree6951c8d0e529dbfc7c4cec75d4cec63350e39b7c /drivers/net/wireless/libertas/mesh.c
parent228e548e602061b08ee8e8966f567c12aa079682 (diff)
parenta70171dce9cd44cb06c7d299eba9fa87a8933045 (diff)
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/libertas/mesh.c')
-rw-r--r--drivers/net/wireless/libertas/mesh.c210
1 files changed, 141 insertions, 69 deletions
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c
index 9d097b9c8005..a0804d12bf20 100644
--- a/drivers/net/wireless/libertas/mesh.c
+++ b/drivers/net/wireless/libertas/mesh.c
@@ -16,12 +16,15 @@
16 * Mesh sysfs support 16 * Mesh sysfs support
17 */ 17 */
18 18
19/** 19/*
20 * Attributes exported through sysfs 20 * Attributes exported through sysfs
21 */ 21 */
22 22
23/** 23/**
24 * @brief Get function for sysfs attribute anycast_mask 24 * lbs_anycast_get - Get function for sysfs attribute anycast_mask
25 * @dev: the &struct device
26 * @attr: device attributes
27 * @buf: buffer where data will be returned
25 */ 28 */
26static ssize_t lbs_anycast_get(struct device *dev, 29static ssize_t lbs_anycast_get(struct device *dev,
27 struct device_attribute *attr, char * buf) 30 struct device_attribute *attr, char * buf)
@@ -40,7 +43,11 @@ static ssize_t lbs_anycast_get(struct device *dev,
40} 43}
41 44
42/** 45/**
43 * @brief Set function for sysfs attribute anycast_mask 46 * lbs_anycast_set - Set function for sysfs attribute anycast_mask
47 * @dev: the &struct device
48 * @attr: device attributes
49 * @buf: buffer that contains new attribute value
50 * @count: size of buffer
44 */ 51 */
45static ssize_t lbs_anycast_set(struct device *dev, 52static ssize_t lbs_anycast_set(struct device *dev,
46 struct device_attribute *attr, const char * buf, size_t count) 53 struct device_attribute *attr, const char * buf, size_t count)
@@ -62,7 +69,10 @@ static ssize_t lbs_anycast_set(struct device *dev,
62} 69}
63 70
64/** 71/**
65 * @brief Get function for sysfs attribute prb_rsp_limit 72 * lbs_prb_rsp_limit_get - Get function for sysfs attribute prb_rsp_limit
73 * @dev: the &struct device
74 * @attr: device attributes
75 * @buf: buffer where data will be returned
66 */ 76 */
67static ssize_t lbs_prb_rsp_limit_get(struct device *dev, 77static ssize_t lbs_prb_rsp_limit_get(struct device *dev,
68 struct device_attribute *attr, char *buf) 78 struct device_attribute *attr, char *buf)
@@ -85,7 +95,11 @@ static ssize_t lbs_prb_rsp_limit_get(struct device *dev,
85} 95}
86 96
87/** 97/**
88 * @brief Set function for sysfs attribute prb_rsp_limit 98 * lbs_prb_rsp_limit_set - Set function for sysfs attribute prb_rsp_limit
99 * @dev: the &struct device
100 * @attr: device attributes
101 * @buf: buffer that contains new attribute value
102 * @count: size of buffer
89 */ 103 */
90static ssize_t lbs_prb_rsp_limit_set(struct device *dev, 104static ssize_t lbs_prb_rsp_limit_set(struct device *dev,
91 struct device_attribute *attr, const char *buf, size_t count) 105 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,
114} 128}
115 129
116/** 130/**
117 * Get function for sysfs attribute mesh 131 * lbs_mesh_get - Get function for sysfs attribute mesh
132 * @dev: the &struct device
133 * @attr: device attributes
134 * @buf: buffer where data will be returned
118 */ 135 */
119static ssize_t lbs_mesh_get(struct device *dev, 136static ssize_t lbs_mesh_get(struct device *dev,
120 struct device_attribute *attr, char * buf) 137 struct device_attribute *attr, char * buf)
@@ -124,7 +141,11 @@ static ssize_t lbs_mesh_get(struct device *dev,
124} 141}
125 142
126/** 143/**
127 * Set function for sysfs attribute mesh 144 * lbs_mesh_set - Set function for sysfs attribute mesh
145 * @dev: the &struct device
146 * @attr: device attributes
147 * @buf: buffer that contains new attribute value
148 * @count: size of buffer
128 */ 149 */
129static ssize_t lbs_mesh_set(struct device *dev, 150static ssize_t lbs_mesh_set(struct device *dev,
130 struct device_attribute *attr, const char * buf, size_t count) 151 struct device_attribute *attr, const char * buf, size_t count)
@@ -151,19 +172,19 @@ static ssize_t lbs_mesh_set(struct device *dev,
151 return count; 172 return count;
152} 173}
153 174
154/** 175/*
155 * lbs_mesh attribute to be exported per ethX interface 176 * lbs_mesh attribute to be exported per ethX interface
156 * through sysfs (/sys/class/net/ethX/lbs_mesh) 177 * through sysfs (/sys/class/net/ethX/lbs_mesh)
157 */ 178 */
158static DEVICE_ATTR(lbs_mesh, 0644, lbs_mesh_get, lbs_mesh_set); 179static DEVICE_ATTR(lbs_mesh, 0644, lbs_mesh_get, lbs_mesh_set);
159 180
160/** 181/*
161 * anycast_mask attribute to be exported per mshX interface 182 * anycast_mask attribute to be exported per mshX interface
162 * through sysfs (/sys/class/net/mshX/anycast_mask) 183 * through sysfs (/sys/class/net/mshX/anycast_mask)
163 */ 184 */
164static DEVICE_ATTR(anycast_mask, 0644, lbs_anycast_get, lbs_anycast_set); 185static DEVICE_ATTR(anycast_mask, 0644, lbs_anycast_get, lbs_anycast_set);
165 186
166/** 187/*
167 * prb_rsp_limit attribute to be exported per mshX interface 188 * prb_rsp_limit attribute to be exported per mshX interface
168 * through sysfs (/sys/class/net/mshX/prb_rsp_limit) 189 * through sysfs (/sys/class/net/mshX/prb_rsp_limit)
169 */ 190 */
@@ -274,10 +295,10 @@ int lbs_deinit_mesh(struct lbs_private *priv)
274 295
275 296
276/** 297/**
277 * @brief This function closes the mshX interface 298 * lbs_mesh_stop - close the mshX interface
278 * 299 *
279 * @param dev A pointer to net_device structure 300 * @dev: A pointer to &net_device structure
280 * @return 0 301 * returns: 0
281 */ 302 */
282static int lbs_mesh_stop(struct net_device *dev) 303static int lbs_mesh_stop(struct net_device *dev)
283{ 304{
@@ -301,10 +322,10 @@ static int lbs_mesh_stop(struct net_device *dev)
301} 322}
302 323
303/** 324/**
304 * @brief This function opens the mshX interface 325 * lbs_mesh_dev_open - open the mshX interface
305 * 326 *
306 * @param dev A pointer to net_device structure 327 * @dev: A pointer to &net_device structure
307 * @return 0 or -EBUSY if monitor mode active 328 * returns: 0 or -EBUSY if monitor mode active
308 */ 329 */
309static int lbs_mesh_dev_open(struct net_device *dev) 330static int lbs_mesh_dev_open(struct net_device *dev)
310{ 331{
@@ -342,10 +363,10 @@ static const struct net_device_ops mesh_netdev_ops = {
342}; 363};
343 364
344/** 365/**
345 * @brief This function adds mshX interface 366 * lbs_add_mesh - add mshX interface
346 * 367 *
347 * @param priv A pointer to the struct lbs_private structure 368 * @priv: A pointer to the &struct lbs_private structure
348 * @return 0 if successful, -X otherwise 369 * returns: 0 if successful, -X otherwise
349 */ 370 */
350int lbs_add_mesh(struct lbs_private *priv) 371int lbs_add_mesh(struct lbs_private *priv)
351{ 372{
@@ -456,13 +477,13 @@ void lbs_mesh_set_txpd(struct lbs_private *priv,
456 */ 477 */
457 478
458/** 479/**
459 * @brief Add or delete Mesh Blinding Table entries 480 * lbs_mesh_bt_add_del - Add or delete Mesh Blinding Table entries
460 * 481 *
461 * @param priv A pointer to struct lbs_private structure 482 * @priv: A pointer to &struct lbs_private structure
462 * @param add TRUE to add the entry, FALSE to delete it 483 * @add: TRUE to add the entry, FALSE to delete it
463 * @param addr1 Destination address to blind or unblind 484 * @addr1: Destination address to blind or unblind
464 * 485 *
465 * @return 0 on success, error on failure 486 * returns: 0 on success, error on failure
466 */ 487 */
467int lbs_mesh_bt_add_del(struct lbs_private *priv, bool add, u8 *addr1) 488int lbs_mesh_bt_add_del(struct lbs_private *priv, bool add, u8 *addr1)
468{ 489{
@@ -493,11 +514,11 @@ int lbs_mesh_bt_add_del(struct lbs_private *priv, bool add, u8 *addr1)
493} 514}
494 515
495/** 516/**
496 * @brief Reset/clear the mesh blinding table 517 * lbs_mesh_bt_reset - Reset/clear the mesh blinding table
497 * 518 *
498 * @param priv A pointer to struct lbs_private structure 519 * @priv: A pointer to &struct lbs_private structure
499 * 520 *
500 * @return 0 on success, error on failure 521 * returns: 0 on success, error on failure
501 */ 522 */
502int lbs_mesh_bt_reset(struct lbs_private *priv) 523int lbs_mesh_bt_reset(struct lbs_private *priv)
503{ 524{
@@ -517,17 +538,18 @@ int lbs_mesh_bt_reset(struct lbs_private *priv)
517} 538}
518 539
519/** 540/**
520 * @brief Gets the inverted status of the mesh blinding table 541 * lbs_mesh_bt_get_inverted - Gets the inverted status of the mesh
542 * blinding table
521 * 543 *
522 * Normally the firmware "blinds" or ignores traffic from mesh nodes in the 544 * Normally the firmware "blinds" or ignores traffic from mesh nodes in the
523 * table, but an inverted table allows *only* traffic from nodes listed in 545 * table, but an inverted table allows *only* traffic from nodes listed in
524 * the table. 546 * the table.
525 * 547 *
526 * @param priv A pointer to struct lbs_private structure 548 * @priv: A pointer to &struct lbs_private structure
527 * @param invert On success, TRUE if the blinding table is inverted, 549 * @inverted: On success, TRUE if the blinding table is inverted,
528 * FALSE if it is not inverted 550 * FALSE if it is not inverted
529 * 551 *
530 * @return 0 on success, error on failure 552 * returns: 0 on success, error on failure
531 */ 553 */
532int lbs_mesh_bt_get_inverted(struct lbs_private *priv, bool *inverted) 554int lbs_mesh_bt_get_inverted(struct lbs_private *priv, bool *inverted)
533{ 555{
@@ -551,18 +573,19 @@ int lbs_mesh_bt_get_inverted(struct lbs_private *priv, bool *inverted)
551} 573}
552 574
553/** 575/**
554 * @brief Sets the inverted status of the mesh blinding table 576 * lbs_mesh_bt_set_inverted - Sets the inverted status of the mesh
577 * blinding table
555 * 578 *
556 * Normally the firmware "blinds" or ignores traffic from mesh nodes in the 579 * Normally the firmware "blinds" or ignores traffic from mesh nodes in the
557 * table, but an inverted table allows *only* traffic from nodes listed in 580 * table, but an inverted table allows *only* traffic from nodes listed in
558 * the table. 581 * the table.
559 * 582 *
560 * @param priv A pointer to struct lbs_private structure 583 * @priv: A pointer to &struct lbs_private structure
561 * @param invert TRUE to invert the blinding table (only traffic from 584 * @inverted: TRUE to invert the blinding table (only traffic from
562 * listed nodes allowed), FALSE to return it 585 * listed nodes allowed), FALSE to return it
563 * to normal state (listed nodes ignored) 586 * to normal state (listed nodes ignored)
564 * 587 *
565 * @return 0 on success, error on failure 588 * returns: 0 on success, error on failure
566 */ 589 */
567int lbs_mesh_bt_set_inverted(struct lbs_private *priv, bool inverted) 590int lbs_mesh_bt_set_inverted(struct lbs_private *priv, bool inverted)
568{ 591{
@@ -583,13 +606,13 @@ int lbs_mesh_bt_set_inverted(struct lbs_private *priv, bool inverted)
583} 606}
584 607
585/** 608/**
586 * @brief List an entry in the mesh blinding table 609 * lbs_mesh_bt_get_entry - List an entry in the mesh blinding table
587 * 610 *
588 * @param priv A pointer to struct lbs_private structure 611 * @priv: A pointer to &struct lbs_private structure
589 * @param id The ID of the entry to list 612 * @id: The ID of the entry to list
590 * @param addr1 MAC address associated with the table entry 613 * @addr1: MAC address associated with the table entry
591 * 614 *
592 * @return 0 on success, error on failure 615 * returns: 0 on success, error on failure
593 */ 616 */
594int lbs_mesh_bt_get_entry(struct lbs_private *priv, u32 id, u8 *addr1) 617int lbs_mesh_bt_get_entry(struct lbs_private *priv, u32 id, u8 *addr1)
595{ 618{
@@ -614,14 +637,14 @@ int lbs_mesh_bt_get_entry(struct lbs_private *priv, u32 id, u8 *addr1)
614} 637}
615 638
616/** 639/**
617 * @brief Access the mesh forwarding table 640 * lbs_cmd_fwt_access - Access the mesh forwarding table
618 * 641 *
619 * @param priv A pointer to struct lbs_private structure 642 * @priv: A pointer to &struct lbs_private structure
620 * @param cmd_action The forwarding table action to perform 643 * @cmd_action: The forwarding table action to perform
621 * @param cmd The pre-filled FWT_ACCESS command 644 * @cmd: The pre-filled FWT_ACCESS command
622 * 645 *
623 * @return 0 on success and 'cmd' will be filled with the 646 * returns: 0 on success and 'cmd' will be filled with the
624 * firmware's response 647 * firmware's response
625 */ 648 */
626int lbs_cmd_fwt_access(struct lbs_private *priv, u16 cmd_action, 649int lbs_cmd_fwt_access(struct lbs_private *priv, u16 cmd_action,
627 struct cmd_ds_fwt_access *cmd) 650 struct cmd_ds_fwt_access *cmd)
@@ -774,7 +797,10 @@ static int mesh_get_default_parameters(struct device *dev,
774} 797}
775 798
776/** 799/**
777 * @brief Get function for sysfs attribute bootflag 800 * bootflag_get - Get function for sysfs attribute bootflag
801 * @dev: the &struct device
802 * @attr: device attributes
803 * @buf: buffer where data will be returned
778 */ 804 */
779static ssize_t bootflag_get(struct device *dev, 805static ssize_t bootflag_get(struct device *dev,
780 struct device_attribute *attr, char *buf) 806 struct device_attribute *attr, char *buf)
@@ -791,7 +817,11 @@ static ssize_t bootflag_get(struct device *dev,
791} 817}
792 818
793/** 819/**
794 * @brief Set function for sysfs attribute bootflag 820 * bootflag_set - Set function for sysfs attribute bootflag
821 * @dev: the &struct device
822 * @attr: device attributes
823 * @buf: buffer that contains new attribute value
824 * @count: size of buffer
795 */ 825 */
796static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr, 826static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr,
797 const char *buf, size_t count) 827 const char *buf, size_t count)
@@ -817,7 +847,10 @@ static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr,
817} 847}
818 848
819/** 849/**
820 * @brief Get function for sysfs attribute boottime 850 * boottime_get - Get function for sysfs attribute boottime
851 * @dev: the &struct device
852 * @attr: device attributes
853 * @buf: buffer where data will be returned
821 */ 854 */
822static ssize_t boottime_get(struct device *dev, 855static ssize_t boottime_get(struct device *dev,
823 struct device_attribute *attr, char *buf) 856 struct device_attribute *attr, char *buf)
@@ -834,7 +867,11 @@ static ssize_t boottime_get(struct device *dev,
834} 867}
835 868
836/** 869/**
837 * @brief Set function for sysfs attribute boottime 870 * boottime_set - Set function for sysfs attribute boottime
871 * @dev: the &struct device
872 * @attr: device attributes
873 * @buf: buffer that contains new attribute value
874 * @count: size of buffer
838 */ 875 */
839static ssize_t boottime_set(struct device *dev, 876static ssize_t boottime_set(struct device *dev,
840 struct device_attribute *attr, const char *buf, size_t count) 877 struct device_attribute *attr, const char *buf, size_t count)
@@ -869,7 +906,10 @@ static ssize_t boottime_set(struct device *dev,
869} 906}
870 907
871/** 908/**
872 * @brief Get function for sysfs attribute channel 909 * channel_get - Get function for sysfs attribute channel
910 * @dev: the &struct device
911 * @attr: device attributes
912 * @buf: buffer where data will be returned
873 */ 913 */
874static ssize_t channel_get(struct device *dev, 914static ssize_t channel_get(struct device *dev,
875 struct device_attribute *attr, char *buf) 915 struct device_attribute *attr, char *buf)
@@ -886,7 +926,11 @@ static ssize_t channel_get(struct device *dev,
886} 926}
887 927
888/** 928/**
889 * @brief Set function for sysfs attribute channel 929 * channel_set - Set function for sysfs attribute channel
930 * @dev: the &struct device
931 * @attr: device attributes
932 * @buf: buffer that contains new attribute value
933 * @count: size of buffer
890 */ 934 */
891static ssize_t channel_set(struct device *dev, struct device_attribute *attr, 935static ssize_t channel_set(struct device *dev, struct device_attribute *attr,
892 const char *buf, size_t count) 936 const char *buf, size_t count)
@@ -912,7 +956,10 @@ static ssize_t channel_set(struct device *dev, struct device_attribute *attr,
912} 956}
913 957
914/** 958/**
915 * @brief Get function for sysfs attribute mesh_id 959 * mesh_id_get - Get function for sysfs attribute mesh_id
960 * @dev: the &struct device
961 * @attr: device attributes
962 * @buf: buffer where data will be returned
916 */ 963 */
917static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr, 964static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,
918 char *buf) 965 char *buf)
@@ -938,7 +985,11 @@ static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,
938} 985}
939 986
940/** 987/**
941 * @brief Set function for sysfs attribute mesh_id 988 * mesh_id_set - Set function for sysfs attribute mesh_id
989 * @dev: the &struct device
990 * @attr: device attributes
991 * @buf: buffer that contains new attribute value
992 * @count: size of buffer
942 */ 993 */
943static ssize_t mesh_id_set(struct device *dev, struct device_attribute *attr, 994static ssize_t mesh_id_set(struct device *dev, struct device_attribute *attr,
944 const char *buf, size_t count) 995 const char *buf, size_t count)
@@ -980,7 +1031,10 @@ static ssize_t mesh_id_set(struct device *dev, struct device_attribute *attr,
980} 1031}
981 1032
982/** 1033/**
983 * @brief Get function for sysfs attribute protocol_id 1034 * protocol_id_get - Get function for sysfs attribute protocol_id
1035 * @dev: the &struct device
1036 * @attr: device attributes
1037 * @buf: buffer where data will be returned
984 */ 1038 */
985static ssize_t protocol_id_get(struct device *dev, 1039static ssize_t protocol_id_get(struct device *dev,
986 struct device_attribute *attr, char *buf) 1040 struct device_attribute *attr, char *buf)
@@ -997,7 +1051,11 @@ static ssize_t protocol_id_get(struct device *dev,
997} 1051}
998 1052
999/** 1053/**
1000 * @brief Set function for sysfs attribute protocol_id 1054 * protocol_id_set - Set function for sysfs attribute protocol_id
1055 * @dev: the &struct device
1056 * @attr: device attributes
1057 * @buf: buffer that contains new attribute value
1058 * @count: size of buffer
1001 */ 1059 */
1002static ssize_t protocol_id_set(struct device *dev, 1060static ssize_t protocol_id_set(struct device *dev,
1003 struct device_attribute *attr, const char *buf, size_t count) 1061 struct device_attribute *attr, const char *buf, size_t count)
@@ -1034,7 +1092,10 @@ static ssize_t protocol_id_set(struct device *dev,
1034} 1092}
1035 1093
1036/** 1094/**
1037 * @brief Get function for sysfs attribute metric_id 1095 * metric_id_get - Get function for sysfs attribute metric_id
1096 * @dev: the &struct device
1097 * @attr: device attributes
1098 * @buf: buffer where data will be returned
1038 */ 1099 */
1039static ssize_t metric_id_get(struct device *dev, 1100static ssize_t metric_id_get(struct device *dev,
1040 struct device_attribute *attr, char *buf) 1101 struct device_attribute *attr, char *buf)
@@ -1051,7 +1112,11 @@ static ssize_t metric_id_get(struct device *dev,
1051} 1112}
1052 1113
1053/** 1114/**
1054 * @brief Set function for sysfs attribute metric_id 1115 * metric_id_set - Set function for sysfs attribute metric_id
1116 * @dev: the &struct device
1117 * @attr: device attributes
1118 * @buf: buffer that contains new attribute value
1119 * @count: size of buffer
1055 */ 1120 */
1056static ssize_t metric_id_set(struct device *dev, struct device_attribute *attr, 1121static ssize_t metric_id_set(struct device *dev, struct device_attribute *attr,
1057 const char *buf, size_t count) 1122 const char *buf, size_t count)
@@ -1088,7 +1153,10 @@ static ssize_t metric_id_set(struct device *dev, struct device_attribute *attr,
1088} 1153}
1089 1154
1090/** 1155/**
1091 * @brief Get function for sysfs attribute capability 1156 * capability_get - Get function for sysfs attribute capability
1157 * @dev: the &struct device
1158 * @attr: device attributes
1159 * @buf: buffer where data will be returned
1092 */ 1160 */
1093static ssize_t capability_get(struct device *dev, 1161static ssize_t capability_get(struct device *dev,
1094 struct device_attribute *attr, char *buf) 1162 struct device_attribute *attr, char *buf)
@@ -1105,7 +1173,11 @@ static ssize_t capability_get(struct device *dev,
1105} 1173}
1106 1174
1107/** 1175/**
1108 * @brief Set function for sysfs attribute capability 1176 * capability_set - Set function for sysfs attribute capability
1177 * @dev: the &struct device
1178 * @attr: device attributes
1179 * @buf: buffer that contains new attribute value
1180 * @count: size of buffer
1109 */ 1181 */
1110static ssize_t capability_set(struct device *dev, struct device_attribute *attr, 1182static ssize_t capability_set(struct device *dev, struct device_attribute *attr,
1111 const char *buf, size_t count) 1183 const char *buf, size_t count)