diff options
Diffstat (limited to 'net/tipc/eth_media.c')
| -rw-r--r-- | net/tipc/eth_media.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c index 527e3f0e165..90ac9bfa7ab 100644 --- a/net/tipc/eth_media.c +++ b/net/tipc/eth_media.c | |||
| @@ -48,7 +48,6 @@ | |||
| 48 | * @tipc_packet_type: used in binding TIPC to Ethernet driver | 48 | * @tipc_packet_type: used in binding TIPC to Ethernet driver |
| 49 | * @cleanup: work item used when disabling bearer | 49 | * @cleanup: work item used when disabling bearer |
| 50 | */ | 50 | */ |
| 51 | |||
| 52 | struct eth_bearer { | 51 | struct eth_bearer { |
| 53 | struct tipc_bearer *bearer; | 52 | struct tipc_bearer *bearer; |
| 54 | struct net_device *dev; | 53 | struct net_device *dev; |
| @@ -67,7 +66,6 @@ static struct notifier_block notifier; | |||
| 67 | * Media-dependent "value" field stores MAC address in first 6 bytes | 66 | * Media-dependent "value" field stores MAC address in first 6 bytes |
| 68 | * and zeroes out the remaining bytes. | 67 | * and zeroes out the remaining bytes. |
| 69 | */ | 68 | */ |
| 70 | |||
| 71 | static void eth_media_addr_set(struct tipc_media_addr *a, char *mac) | 69 | static void eth_media_addr_set(struct tipc_media_addr *a, char *mac) |
| 72 | { | 70 | { |
| 73 | memcpy(a->value, mac, ETH_ALEN); | 71 | memcpy(a->value, mac, ETH_ALEN); |
| @@ -79,7 +77,6 @@ static void eth_media_addr_set(struct tipc_media_addr *a, char *mac) | |||
| 79 | /** | 77 | /** |
| 80 | * send_msg - send a TIPC message out over an Ethernet interface | 78 | * send_msg - send a TIPC message out over an Ethernet interface |
| 81 | */ | 79 | */ |
| 82 | |||
| 83 | static int send_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr, | 80 | static int send_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr, |
| 84 | struct tipc_media_addr *dest) | 81 | struct tipc_media_addr *dest) |
| 85 | { | 82 | { |
| @@ -115,7 +112,6 @@ static int send_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr, | |||
| 115 | * ignores packets sent using Ethernet multicast, and traffic sent to other | 112 | * ignores packets sent using Ethernet multicast, and traffic sent to other |
| 116 | * nodes (which can happen if interface is running in promiscuous mode). | 113 | * nodes (which can happen if interface is running in promiscuous mode). |
| 117 | */ | 114 | */ |
| 118 | |||
| 119 | static int recv_msg(struct sk_buff *buf, struct net_device *dev, | 115 | static int recv_msg(struct sk_buff *buf, struct net_device *dev, |
| 120 | struct packet_type *pt, struct net_device *orig_dev) | 116 | struct packet_type *pt, struct net_device *orig_dev) |
| 121 | { | 117 | { |
| @@ -140,7 +136,6 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev, | |||
| 140 | /** | 136 | /** |
| 141 | * enable_bearer - attach TIPC bearer to an Ethernet interface | 137 | * enable_bearer - attach TIPC bearer to an Ethernet interface |
| 142 | */ | 138 | */ |
| 143 | |||
| 144 | static int enable_bearer(struct tipc_bearer *tb_ptr) | 139 | static int enable_bearer(struct tipc_bearer *tb_ptr) |
| 145 | { | 140 | { |
| 146 | struct net_device *dev = NULL; | 141 | struct net_device *dev = NULL; |
| @@ -151,7 +146,6 @@ static int enable_bearer(struct tipc_bearer *tb_ptr) | |||
| 151 | int pending_dev = 0; | 146 | int pending_dev = 0; |
| 152 | 147 | ||
| 153 | /* Find unused Ethernet bearer structure */ | 148 | /* Find unused Ethernet bearer structure */ |
| 154 | |||
| 155 | while (eb_ptr->dev) { | 149 | while (eb_ptr->dev) { |
| 156 | if (!eb_ptr->bearer) | 150 | if (!eb_ptr->bearer) |
| 157 | pending_dev++; | 151 | pending_dev++; |
| @@ -160,7 +154,6 @@ static int enable_bearer(struct tipc_bearer *tb_ptr) | |||
| 160 | } | 154 | } |
| 161 | 155 | ||
| 162 | /* Find device with specified name */ | 156 | /* Find device with specified name */ |
| 163 | |||
| 164 | read_lock(&dev_base_lock); | 157 | read_lock(&dev_base_lock); |
| 165 | for_each_netdev(&init_net, pdev) { | 158 | for_each_netdev(&init_net, pdev) { |
| 166 | if (!strncmp(pdev->name, driver_name, IFNAMSIZ)) { | 159 | if (!strncmp(pdev->name, driver_name, IFNAMSIZ)) { |
| @@ -174,7 +167,6 @@ static int enable_bearer(struct tipc_bearer *tb_ptr) | |||
| 174 | return -ENODEV; | 167 | return -ENODEV; |
| 175 | 168 | ||
| 176 | /* Create Ethernet bearer for device */ | 169 | /* Create Ethernet bearer for device */ |
| 177 | |||
| 178 | eb_ptr->dev = dev; | 170 | eb_ptr->dev = dev; |
| 179 | eb_ptr->tipc_packet_type.type = htons(ETH_P_TIPC); | 171 | eb_ptr->tipc_packet_type.type = htons(ETH_P_TIPC); |
| 180 | eb_ptr->tipc_packet_type.dev = dev; | 172 | eb_ptr->tipc_packet_type.dev = dev; |
| @@ -184,7 +176,6 @@ static int enable_bearer(struct tipc_bearer *tb_ptr) | |||
| 184 | dev_add_pack(&eb_ptr->tipc_packet_type); | 176 | dev_add_pack(&eb_ptr->tipc_packet_type); |
| 185 | 177 | ||
| 186 | /* Associate TIPC bearer with Ethernet bearer */ | 178 | /* Associate TIPC bearer with Ethernet bearer */ |
| 187 | |||
| 188 | eb_ptr->bearer = tb_ptr; | 179 | eb_ptr->bearer = tb_ptr; |
| 189 | tb_ptr->usr_handle = (void *)eb_ptr; | 180 | tb_ptr->usr_handle = (void *)eb_ptr; |
| 190 | tb_ptr->mtu = dev->mtu; | 181 | tb_ptr->mtu = dev->mtu; |
| @@ -198,7 +189,6 @@ static int enable_bearer(struct tipc_bearer *tb_ptr) | |||
| 198 | * | 189 | * |
| 199 | * This routine must be invoked from a work queue because it can sleep. | 190 | * This routine must be invoked from a work queue because it can sleep. |
| 200 | */ | 191 | */ |
| 201 | |||
| 202 | static void cleanup_bearer(struct work_struct *work) | 192 | static void cleanup_bearer(struct work_struct *work) |
| 203 | { | 193 | { |
| 204 | struct eth_bearer *eb_ptr = | 194 | struct eth_bearer *eb_ptr = |
| @@ -216,7 +206,6 @@ static void cleanup_bearer(struct work_struct *work) | |||
| 216 | * then get worker thread to complete bearer cleanup. (Can't do cleanup | 206 | * then get worker thread to complete bearer cleanup. (Can't do cleanup |
| 217 | * here because cleanup code needs to sleep and caller holds spinlocks.) | 207 | * here because cleanup code needs to sleep and caller holds spinlocks.) |
| 218 | */ | 208 | */ |
| 219 | |||
| 220 | static void disable_bearer(struct tipc_bearer *tb_ptr) | 209 | static void disable_bearer(struct tipc_bearer *tb_ptr) |
| 221 | { | 210 | { |
| 222 | struct eth_bearer *eb_ptr = (struct eth_bearer *)tb_ptr->usr_handle; | 211 | struct eth_bearer *eb_ptr = (struct eth_bearer *)tb_ptr->usr_handle; |
| @@ -232,7 +221,6 @@ static void disable_bearer(struct tipc_bearer *tb_ptr) | |||
| 232 | * Change the state of the Ethernet bearer (if any) associated with the | 221 | * Change the state of the Ethernet bearer (if any) associated with the |
| 233 | * specified device. | 222 | * specified device. |
| 234 | */ | 223 | */ |
| 235 | |||
| 236 | static int recv_notification(struct notifier_block *nb, unsigned long evt, | 224 | static int recv_notification(struct notifier_block *nb, unsigned long evt, |
| 237 | void *dv) | 225 | void *dv) |
| 238 | { | 226 | { |
| @@ -281,7 +269,6 @@ static int recv_notification(struct notifier_block *nb, unsigned long evt, | |||
| 281 | /** | 269 | /** |
| 282 | * eth_addr2str - convert Ethernet address to string | 270 | * eth_addr2str - convert Ethernet address to string |
| 283 | */ | 271 | */ |
| 284 | |||
| 285 | static int eth_addr2str(struct tipc_media_addr *a, char *str_buf, int str_size) | 272 | static int eth_addr2str(struct tipc_media_addr *a, char *str_buf, int str_size) |
| 286 | { | 273 | { |
| 287 | if (str_size < 18) /* 18 = strlen("aa:bb:cc:dd:ee:ff\0") */ | 274 | if (str_size < 18) /* 18 = strlen("aa:bb:cc:dd:ee:ff\0") */ |
| @@ -294,7 +281,6 @@ static int eth_addr2str(struct tipc_media_addr *a, char *str_buf, int str_size) | |||
| 294 | /** | 281 | /** |
| 295 | * eth_str2addr - convert string to Ethernet address | 282 | * eth_str2addr - convert string to Ethernet address |
| 296 | */ | 283 | */ |
| 297 | |||
| 298 | static int eth_str2addr(struct tipc_media_addr *a, char *str_buf) | 284 | static int eth_str2addr(struct tipc_media_addr *a, char *str_buf) |
| 299 | { | 285 | { |
| 300 | char mac[ETH_ALEN]; | 286 | char mac[ETH_ALEN]; |
| @@ -314,7 +300,6 @@ static int eth_str2addr(struct tipc_media_addr *a, char *str_buf) | |||
| 314 | /** | 300 | /** |
| 315 | * eth_str2addr - convert Ethernet address format to message header format | 301 | * eth_str2addr - convert Ethernet address format to message header format |
| 316 | */ | 302 | */ |
| 317 | |||
| 318 | static int eth_addr2msg(struct tipc_media_addr *a, char *msg_area) | 303 | static int eth_addr2msg(struct tipc_media_addr *a, char *msg_area) |
| 319 | { | 304 | { |
| 320 | memset(msg_area, 0, TIPC_MEDIA_ADDR_SIZE); | 305 | memset(msg_area, 0, TIPC_MEDIA_ADDR_SIZE); |
| @@ -326,7 +311,6 @@ static int eth_addr2msg(struct tipc_media_addr *a, char *msg_area) | |||
| 326 | /** | 311 | /** |
| 327 | * eth_str2addr - convert message header address format to Ethernet format | 312 | * eth_str2addr - convert message header address format to Ethernet format |
| 328 | */ | 313 | */ |
| 329 | |||
| 330 | static int eth_msg2addr(struct tipc_media_addr *a, char *msg_area) | 314 | static int eth_msg2addr(struct tipc_media_addr *a, char *msg_area) |
| 331 | { | 315 | { |
| 332 | if (msg_area[TIPC_MEDIA_TYPE_OFFSET] != TIPC_MEDIA_TYPE_ETH) | 316 | if (msg_area[TIPC_MEDIA_TYPE_OFFSET] != TIPC_MEDIA_TYPE_ETH) |
| @@ -339,7 +323,6 @@ static int eth_msg2addr(struct tipc_media_addr *a, char *msg_area) | |||
| 339 | /* | 323 | /* |
| 340 | * Ethernet media registration info | 324 | * Ethernet media registration info |
| 341 | */ | 325 | */ |
| 342 | |||
| 343 | static struct tipc_media eth_media_info = { | 326 | static struct tipc_media eth_media_info = { |
| 344 | .send_msg = send_msg, | 327 | .send_msg = send_msg, |
| 345 | .enable_bearer = enable_bearer, | 328 | .enable_bearer = enable_bearer, |
| @@ -363,7 +346,6 @@ static struct tipc_media eth_media_info = { | |||
| 363 | * Register Ethernet media type with TIPC bearer code. Also register | 346 | * Register Ethernet media type with TIPC bearer code. Also register |
| 364 | * with OS for notifications about device state changes. | 347 | * with OS for notifications about device state changes. |
| 365 | */ | 348 | */ |
| 366 | |||
| 367 | int tipc_eth_media_start(void) | 349 | int tipc_eth_media_start(void) |
| 368 | { | 350 | { |
| 369 | int res; | 351 | int res; |
| @@ -386,7 +368,6 @@ int tipc_eth_media_start(void) | |||
| 386 | /** | 368 | /** |
| 387 | * tipc_eth_media_stop - deactivate Ethernet bearer support | 369 | * tipc_eth_media_stop - deactivate Ethernet bearer support |
| 388 | */ | 370 | */ |
| 389 | |||
| 390 | void tipc_eth_media_stop(void) | 371 | void tipc_eth_media_stop(void) |
| 391 | { | 372 | { |
| 392 | if (!eth_started) | 373 | if (!eth_started) |
