diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2013-12-10 23:45:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-11 00:17:42 -0500 |
commit | ef72a7e02a28adfd9d5d0d1de81c0b75f3823aa5 (patch) | |
tree | e267d1860382bd7f27c1b7d25be652eee0ac6471 /net/tipc | |
parent | 5702dbab687e19792102200b085108f00ab820c9 (diff) |
tipc: improve naming and comment consistency in media layer
struct 'tipc_media' represents the specific info that the media
layer adaptors (eth_media and ib_media) expose to the generic
bearer layer. We clarify this by improved commenting, and by giving
the 'media_list' array the more appropriate name 'media_info_array'.
There are no functional changes in this commit.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/bearer.c | 32 | ||||
-rw-r--r-- | net/tipc/bearer.h | 6 |
2 files changed, 19 insertions, 19 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 826aa9fdf45f..2411bac2b8f9 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -41,7 +41,7 @@ | |||
41 | 41 | ||
42 | #define MAX_ADDR_STR 60 | 42 | #define MAX_ADDR_STR 60 |
43 | 43 | ||
44 | static struct tipc_media * const media_list[] = { | 44 | static struct tipc_media * const media_info_array[] = { |
45 | ð_media_info, | 45 | ð_media_info, |
46 | #ifdef CONFIG_TIPC_MEDIA_IB | 46 | #ifdef CONFIG_TIPC_MEDIA_IB |
47 | &ib_media_info, | 47 | &ib_media_info, |
@@ -60,11 +60,11 @@ struct tipc_media *tipc_media_find(const char *name) | |||
60 | { | 60 | { |
61 | u32 i; | 61 | u32 i; |
62 | 62 | ||
63 | for (i = 0; media_list[i] != NULL; i++) { | 63 | for (i = 0; media_info_array[i] != NULL; i++) { |
64 | if (!strcmp(media_list[i]->name, name)) | 64 | if (!strcmp(media_info_array[i]->name, name)) |
65 | break; | 65 | break; |
66 | } | 66 | } |
67 | return media_list[i]; | 67 | return media_info_array[i]; |
68 | } | 68 | } |
69 | 69 | ||
70 | /** | 70 | /** |
@@ -74,11 +74,11 @@ static struct tipc_media *media_find_id(u8 type) | |||
74 | { | 74 | { |
75 | u32 i; | 75 | u32 i; |
76 | 76 | ||
77 | for (i = 0; media_list[i] != NULL; i++) { | 77 | for (i = 0; media_info_array[i] != NULL; i++) { |
78 | if (media_list[i]->type_id == type) | 78 | if (media_info_array[i]->type_id == type) |
79 | break; | 79 | break; |
80 | } | 80 | } |
81 | return media_list[i]; | 81 | return media_info_array[i]; |
82 | } | 82 | } |
83 | 83 | ||
84 | /** | 84 | /** |
@@ -116,10 +116,10 @@ struct sk_buff *tipc_media_get_names(void) | |||
116 | if (!buf) | 116 | if (!buf) |
117 | return NULL; | 117 | return NULL; |
118 | 118 | ||
119 | for (i = 0; media_list[i] != NULL; i++) { | 119 | for (i = 0; media_info_array[i] != NULL; i++) { |
120 | tipc_cfg_append_tlv(buf, TIPC_TLV_MEDIA_NAME, | 120 | tipc_cfg_append_tlv(buf, TIPC_TLV_MEDIA_NAME, |
121 | media_list[i]->name, | 121 | media_info_array[i]->name, |
122 | strlen(media_list[i]->name) + 1); | 122 | strlen(media_info_array[i]->name) + 1); |
123 | } | 123 | } |
124 | return buf; | 124 | return buf; |
125 | } | 125 | } |
@@ -209,7 +209,7 @@ struct tipc_bearer *tipc_bearer_find_interface(const char *if_name) | |||
209 | struct sk_buff *tipc_bearer_get_names(void) | 209 | struct sk_buff *tipc_bearer_get_names(void) |
210 | { | 210 | { |
211 | struct sk_buff *buf; | 211 | struct sk_buff *buf; |
212 | struct tipc_bearer *b_ptr; | 212 | struct tipc_bearer *b; |
213 | int i, j; | 213 | int i, j; |
214 | 214 | ||
215 | buf = tipc_cfg_reply_alloc(MAX_BEARERS * TLV_SPACE(TIPC_MAX_BEARER_NAME)); | 215 | buf = tipc_cfg_reply_alloc(MAX_BEARERS * TLV_SPACE(TIPC_MAX_BEARER_NAME)); |
@@ -217,13 +217,13 @@ struct sk_buff *tipc_bearer_get_names(void) | |||
217 | return NULL; | 217 | return NULL; |
218 | 218 | ||
219 | read_lock_bh(&tipc_net_lock); | 219 | read_lock_bh(&tipc_net_lock); |
220 | for (i = 0; media_list[i] != NULL; i++) { | 220 | for (i = 0; media_info_array[i] != NULL; i++) { |
221 | for (j = 0; j < MAX_BEARERS; j++) { | 221 | for (j = 0; j < MAX_BEARERS; j++) { |
222 | b_ptr = &tipc_bearers[j]; | 222 | b = &tipc_bearers[j]; |
223 | if (b_ptr->active && (b_ptr->media == media_list[i])) { | 223 | if (b->active && (b->media == media_info_array[i])) { |
224 | tipc_cfg_append_tlv(buf, TIPC_TLV_BEARER_NAME, | 224 | tipc_cfg_append_tlv(buf, TIPC_TLV_BEARER_NAME, |
225 | b_ptr->name, | 225 | b->name, |
226 | strlen(b_ptr->name) + 1); | 226 | strlen(b->name) + 1); |
227 | } | 227 | } |
228 | } | 228 | } |
229 | } | 229 | } |
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 516af8c0577d..e50266aa4d10 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h | |||
@@ -73,14 +73,13 @@ struct tipc_media_addr { | |||
73 | struct tipc_bearer; | 73 | struct tipc_bearer; |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * struct tipc_media - TIPC media information available to internal users | 76 | * struct tipc_media - Media specific info exposed to generic bearer layer |
77 | * @send_msg: routine which handles buffer transmission | 77 | * @send_msg: routine which handles buffer transmission |
78 | * @enable_media: routine which enables a media | 78 | * @enable_media: routine which enables a media |
79 | * @disable_media: routine which disables a media | 79 | * @disable_media: routine which disables a media |
80 | * @addr2str: routine which converts media address to string | 80 | * @addr2str: routine which converts media address to string |
81 | * @addr2msg: routine which converts media address to protocol message area | 81 | * @addr2msg: routine which converts media address to protocol message area |
82 | * @msg2addr: routine which converts media address from protocol message area | 82 | * @msg2addr: routine which converts media address from protocol message area |
83 | * @bcast_addr: media address used in broadcasting | ||
84 | * @priority: default link (and bearer) priority | 83 | * @priority: default link (and bearer) priority |
85 | * @tolerance: default time (in ms) before declaring link failure | 84 | * @tolerance: default time (in ms) before declaring link failure |
86 | * @window: default window (in packets) before declaring link congestion | 85 | * @window: default window (in packets) before declaring link congestion |
@@ -105,13 +104,14 @@ struct tipc_media { | |||
105 | }; | 104 | }; |
106 | 105 | ||
107 | /** | 106 | /** |
108 | * struct tipc_bearer - TIPC bearer structure | 107 | * struct tipc_bearer - Generic TIPC bearer structure |
109 | * @usr_handle: pointer to additional media-specific information about bearer | 108 | * @usr_handle: pointer to additional media-specific information about bearer |
110 | * @mtu: max packet size bearer can support | 109 | * @mtu: max packet size bearer can support |
111 | * @lock: spinlock for controlling access to bearer | 110 | * @lock: spinlock for controlling access to bearer |
112 | * @addr: media-specific address associated with bearer | 111 | * @addr: media-specific address associated with bearer |
113 | * @name: bearer name (format = media:interface) | 112 | * @name: bearer name (format = media:interface) |
114 | * @media: ptr to media structure associated with bearer | 113 | * @media: ptr to media structure associated with bearer |
114 | * @bcast_addr: media address used in broadcasting | ||
115 | * @priority: default link priority for bearer | 115 | * @priority: default link priority for bearer |
116 | * @window: default window size for bearer | 116 | * @window: default window size for bearer |
117 | * @tolerance: default link tolerance for bearer | 117 | * @tolerance: default link tolerance for bearer |