diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 00:04:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 00:04:44 -0400 |
commit | f8965467f366fd18f01feafb5db10512d7b4422c (patch) | |
tree | 3706a9cd779859271ca61b85c63a1bc3f82d626e /net/tipc/config.c | |
parent | a26272e5200765691e67d6780e52b32498fdb659 (diff) | |
parent | 2ec8c6bb5d8f3a62a79f463525054bae1e3d4487 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits)
qlcnic: adding co maintainer
ixgbe: add support for active DA cables
ixgbe: dcb, do not tag tc_prio_control frames
ixgbe: fix ixgbe_tx_is_paused logic
ixgbe: always enable vlan strip/insert when DCB is enabled
ixgbe: remove some redundant code in setting FCoE FIP filter
ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp
ixgbe: fix header len when unsplit packet overflows to data buffer
ipv6: Never schedule DAD timer on dead address
ipv6: Use POSTDAD state
ipv6: Use state_lock to protect ifa state
ipv6: Replace inet6_ifaddr->dead with state
cxgb4: notify upper drivers if the device is already up when they load
cxgb4: keep interrupts available when the ports are brought down
cxgb4: fix initial addition of MAC address
cnic: Return SPQ credit to bnx2x after ring setup and shutdown.
cnic: Convert cnic_local_flags to atomic ops.
can: Fix SJA1000 command register writes on SMP systems
bridge: fix build for CONFIG_SYSFS disabled
ARCNET: Limit com20020 PCI ID matches for SOHARD cards
...
Fix up various conflicts with pcmcia tree drivers/net/
{pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and
wireless/orinoco/spectrum_cs.c} and feature removal
(Documentation/feature-removal-schedule.txt).
Also fix a non-content conflict due to pm_qos_requirement getting
renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c
Diffstat (limited to 'net/tipc/config.c')
-rw-r--r-- | net/tipc/config.c | 68 |
1 files changed, 53 insertions, 15 deletions
diff --git a/net/tipc/config.c b/net/tipc/config.c index ca3544d030c7..961d1b097146 100644 --- a/net/tipc/config.c +++ b/net/tipc/config.c | |||
@@ -56,9 +56,6 @@ struct subscr_data { | |||
56 | struct manager { | 56 | struct manager { |
57 | u32 user_ref; | 57 | u32 user_ref; |
58 | u32 port_ref; | 58 | u32 port_ref; |
59 | u32 subscr_ref; | ||
60 | u32 link_subscriptions; | ||
61 | struct list_head link_subscribers; | ||
62 | }; | 59 | }; |
63 | 60 | ||
64 | static struct manager mng = { 0}; | 61 | static struct manager mng = { 0}; |
@@ -70,12 +67,6 @@ static int req_tlv_space; /* request message TLV area size */ | |||
70 | static int rep_headroom; /* reply message headroom to use */ | 67 | static int rep_headroom; /* reply message headroom to use */ |
71 | 68 | ||
72 | 69 | ||
73 | void tipc_cfg_link_event(u32 addr, char *name, int up) | ||
74 | { | ||
75 | /* TIPC DOESN'T HANDLE LINK EVENT SUBSCRIPTIONS AT THE MOMENT */ | ||
76 | } | ||
77 | |||
78 | |||
79 | struct sk_buff *tipc_cfg_reply_alloc(int payload_size) | 70 | struct sk_buff *tipc_cfg_reply_alloc(int payload_size) |
80 | { | 71 | { |
81 | struct sk_buff *buf; | 72 | struct sk_buff *buf; |
@@ -130,12 +121,24 @@ struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string) | |||
130 | } | 121 | } |
131 | 122 | ||
132 | 123 | ||
133 | |||
134 | |||
135 | #if 0 | 124 | #if 0 |
136 | 125 | ||
137 | /* Now obsolete code for handling commands not yet implemented the new way */ | 126 | /* Now obsolete code for handling commands not yet implemented the new way */ |
138 | 127 | ||
128 | /* | ||
129 | * Some of this code assumed that the manager structure contains two added | ||
130 | * fields: | ||
131 | * u32 link_subscriptions; | ||
132 | * struct list_head link_subscribers; | ||
133 | * which are currently not present. These fields may need to be re-introduced | ||
134 | * if and when support for link subscriptions is added. | ||
135 | */ | ||
136 | |||
137 | void tipc_cfg_link_event(u32 addr, char *name, int up) | ||
138 | { | ||
139 | /* TIPC DOESN'T HANDLE LINK EVENT SUBSCRIPTIONS AT THE MOMENT */ | ||
140 | } | ||
141 | |||
139 | int tipc_cfg_cmd(const struct tipc_cmd_msg * msg, | 142 | int tipc_cfg_cmd(const struct tipc_cmd_msg * msg, |
140 | char *data, | 143 | char *data, |
141 | u32 sz, | 144 | u32 sz, |
@@ -243,13 +246,48 @@ static void cfg_cmd_event(struct tipc_cmd_msg *msg, | |||
243 | default: | 246 | default: |
244 | rv = tipc_cfg_cmd(msg, data, sz, (u32 *)&msg_sect[1].iov_len, orig); | 247 | rv = tipc_cfg_cmd(msg, data, sz, (u32 *)&msg_sect[1].iov_len, orig); |
245 | } | 248 | } |
246 | exit: | 249 | exit: |
247 | rmsg.result_len = htonl(msg_sect[1].iov_len); | 250 | rmsg.result_len = htonl(msg_sect[1].iov_len); |
248 | rmsg.retval = htonl(rv); | 251 | rmsg.retval = htonl(rv); |
249 | tipc_cfg_respond(msg_sect, 2u, orig); | 252 | tipc_cfg_respond(msg_sect, 2u, orig); |
250 | } | 253 | } |
251 | #endif | 254 | #endif |
252 | 255 | ||
256 | #define MAX_STATS_INFO 2000 | ||
257 | |||
258 | static struct sk_buff *tipc_show_stats(void) | ||
259 | { | ||
260 | struct sk_buff *buf; | ||
261 | struct tlv_desc *rep_tlv; | ||
262 | struct print_buf pb; | ||
263 | int str_len; | ||
264 | u32 value; | ||
265 | |||
266 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) | ||
267 | return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); | ||
268 | |||
269 | value = ntohl(*(u32 *)TLV_DATA(req_tlv_area)); | ||
270 | if (value != 0) | ||
271 | return tipc_cfg_reply_error_string("unsupported argument"); | ||
272 | |||
273 | buf = tipc_cfg_reply_alloc(TLV_SPACE(MAX_STATS_INFO)); | ||
274 | if (buf == NULL) | ||
275 | return NULL; | ||
276 | |||
277 | rep_tlv = (struct tlv_desc *)buf->data; | ||
278 | tipc_printbuf_init(&pb, (char *)TLV_DATA(rep_tlv), MAX_STATS_INFO); | ||
279 | |||
280 | tipc_printf(&pb, "TIPC version " TIPC_MOD_VER "\n"); | ||
281 | |||
282 | /* Use additional tipc_printf()'s to return more info ... */ | ||
283 | |||
284 | str_len = tipc_printbuf_validate(&pb); | ||
285 | skb_put(buf, TLV_SPACE(str_len)); | ||
286 | TLV_SET(rep_tlv, TIPC_TLV_ULTRA_STRING, NULL, str_len); | ||
287 | |||
288 | return buf; | ||
289 | } | ||
290 | |||
253 | static struct sk_buff *cfg_enable_bearer(void) | 291 | static struct sk_buff *cfg_enable_bearer(void) |
254 | { | 292 | { |
255 | struct tipc_bearer_config *args; | 293 | struct tipc_bearer_config *args; |
@@ -533,6 +571,9 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area | |||
533 | case TIPC_CMD_DUMP_LOG: | 571 | case TIPC_CMD_DUMP_LOG: |
534 | rep_tlv_buf = tipc_log_dump(); | 572 | rep_tlv_buf = tipc_log_dump(); |
535 | break; | 573 | break; |
574 | case TIPC_CMD_SHOW_STATS: | ||
575 | rep_tlv_buf = tipc_show_stats(); | ||
576 | break; | ||
536 | case TIPC_CMD_SET_LINK_TOL: | 577 | case TIPC_CMD_SET_LINK_TOL: |
537 | case TIPC_CMD_SET_LINK_PRI: | 578 | case TIPC_CMD_SET_LINK_PRI: |
538 | case TIPC_CMD_SET_LINK_WINDOW: | 579 | case TIPC_CMD_SET_LINK_WINDOW: |
@@ -667,9 +708,6 @@ int tipc_cfg_init(void) | |||
667 | struct tipc_name_seq seq; | 708 | struct tipc_name_seq seq; |
668 | int res; | 709 | int res; |
669 | 710 | ||
670 | memset(&mng, 0, sizeof(mng)); | ||
671 | INIT_LIST_HEAD(&mng.link_subscribers); | ||
672 | |||
673 | res = tipc_attach(&mng.user_ref, NULL, NULL); | 711 | res = tipc_attach(&mng.user_ref, NULL, NULL); |
674 | if (res) | 712 | if (res) |
675 | goto failed; | 713 | goto failed; |