xpnet.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1999-2009 Silicon Graphics, Inc. All rights reserved.
  7. */
  8. /*
  9. * Cross Partition Network Interface (XPNET) support
  10. *
  11. * XPNET provides a virtual network layered on top of the Cross
  12. * Partition communication layer.
  13. *
  14. * XPNET provides direct point-to-point and broadcast-like support
  15. * for an ethernet-like device. The ethernet broadcast medium is
  16. * replaced with a point-to-point message structure which passes
  17. * pointers to a DMA-capable block that a remote partition should
  18. * retrieve and pass to the upper level networking layer.
  19. *
  20. */
  21. #include <linux/slab.h>
  22. #include <linux/module.h>
  23. #include <linux/netdevice.h>
  24. #include <linux/etherdevice.h>
  25. #include "xp.h"
  26. /*
  27. * The message payload transferred by XPC.
  28. *
  29. * buf_pa is the physical address where the DMA should pull from.
  30. *
  31. * NOTE: for performance reasons, buf_pa should _ALWAYS_ begin on a
  32. * cacheline boundary. To accomplish this, we record the number of
  33. * bytes from the beginning of the first cacheline to the first useful
  34. * byte of the skb (leadin_ignore) and the number of bytes from the
  35. * last useful byte of the skb to the end of the last cacheline
  36. * (tailout_ignore).
  37. *
  38. * size is the number of bytes to transfer which includes the skb->len
  39. * (useful bytes of the senders skb) plus the leadin and tailout
  40. */
  41. struct xpnet_message {
  42. u16 version; /* Version for this message */
  43. u16 embedded_bytes; /* #of bytes embedded in XPC message */
  44. u32 magic; /* Special number indicating this is xpnet */
  45. unsigned long buf_pa; /* phys address of buffer to retrieve */
  46. u32 size; /* #of bytes in buffer */
  47. u8 leadin_ignore; /* #of bytes to ignore at the beginning */
  48. u8 tailout_ignore; /* #of bytes to ignore at the end */
  49. unsigned char data; /* body of small packets */
  50. };
  51. /*
  52. * Determine the size of our message, the cacheline aligned size,
  53. * and then the number of message will request from XPC.
  54. *
  55. * XPC expects each message to exist in an individual cacheline.
  56. */
  57. #define XPNET_MSG_SIZE XPC_MSG_PAYLOAD_MAX_SIZE
  58. #define XPNET_MSG_DATA_MAX \
  59. (XPNET_MSG_SIZE - offsetof(struct xpnet_message, data))
  60. #define XPNET_MSG_NENTRIES (PAGE_SIZE / XPC_MSG_MAX_SIZE)
  61. #define XPNET_MAX_KTHREADS (XPNET_MSG_NENTRIES + 1)
  62. #define XPNET_MAX_IDLE_KTHREADS (XPNET_MSG_NENTRIES + 1)
  63. /*
  64. * Version number of XPNET implementation. XPNET can always talk to versions
  65. * with same major #, and never talk to versions with a different version.
  66. */
  67. #define _XPNET_VERSION(_major, _minor) (((_major) << 4) | (_minor))
  68. #define XPNET_VERSION_MAJOR(_v) ((_v) >> 4)
  69. #define XPNET_VERSION_MINOR(_v) ((_v) & 0xf)
  70. #define XPNET_VERSION _XPNET_VERSION(1, 0) /* version 1.0 */
  71. #define XPNET_VERSION_EMBED _XPNET_VERSION(1, 1) /* version 1.1 */
  72. #define XPNET_MAGIC 0x88786984 /* "XNET" */
  73. #define XPNET_VALID_MSG(_m) \
  74. ((XPNET_VERSION_MAJOR(_m->version) == XPNET_VERSION_MAJOR(XPNET_VERSION)) \
  75. && (msg->magic == XPNET_MAGIC))
  76. #define XPNET_DEVICE_NAME "xp0"
  77. /*
  78. * When messages are queued with xpc_send_notify, a kmalloc'd buffer
  79. * of the following type is passed as a notification cookie. When the
  80. * notification function is called, we use the cookie to decide
  81. * whether all outstanding message sends have completed. The skb can
  82. * then be released.
  83. */
  84. struct xpnet_pending_msg {
  85. struct sk_buff *skb;
  86. atomic_t use_count;
  87. };
  88. struct net_device *xpnet_device;
  89. /*
  90. * When we are notified of other partitions activating, we add them to
  91. * our bitmask of partitions to which we broadcast.
  92. */
  93. static unsigned long *xpnet_broadcast_partitions;
  94. /* protect above */
  95. static DEFINE_SPINLOCK(xpnet_broadcast_lock);
  96. /*
  97. * Since the Block Transfer Engine (BTE) is being used for the transfer
  98. * and it relies upon cache-line size transfers, we need to reserve at
  99. * least one cache-line for head and tail alignment. The BTE is
  100. * limited to 8MB transfers.
  101. *
  102. * Testing has shown that changing MTU to greater than 64KB has no effect
  103. * on TCP as the two sides negotiate a Max Segment Size that is limited
  104. * to 64K. Other protocols May use packets greater than this, but for
  105. * now, the default is 64KB.
  106. */
  107. #define XPNET_MAX_MTU (0x800000UL - L1_CACHE_BYTES)
  108. /* 68 comes from min TCP+IP+MAC header */
  109. #define XPNET_MIN_MTU 68
  110. /* 32KB has been determined to be the ideal */
  111. #define XPNET_DEF_MTU (0x8000UL)
  112. /*
  113. * The partid is encapsulated in the MAC address beginning in the following
  114. * octet and it consists of two octets.
  115. */
  116. #define XPNET_PARTID_OCTET 2
  117. /* Define the XPNET debug device structures to be used with dev_dbg() et al */
  118. struct device_driver xpnet_dbg_name = {
  119. .name = "xpnet"
  120. };
  121. struct device xpnet_dbg_subname = {
  122. .init_name = "", /* set to "" */
  123. .driver = &xpnet_dbg_name
  124. };
  125. struct device *xpnet = &xpnet_dbg_subname;
  126. /*
  127. * Packet was recevied by XPC and forwarded to us.
  128. */
  129. static void
  130. xpnet_receive(short partid, int channel, struct xpnet_message *msg)
  131. {
  132. struct sk_buff *skb;
  133. void *dst;
  134. enum xp_retval ret;
  135. if (!XPNET_VALID_MSG(msg)) {
  136. /*
  137. * Packet with a different XPC version. Ignore.
  138. */
  139. xpc_received(partid, channel, (void *)msg);
  140. xpnet_device->stats.rx_errors++;
  141. return;
  142. }
  143. dev_dbg(xpnet, "received 0x%lx, %d, %d, %d\n", msg->buf_pa, msg->size,
  144. msg->leadin_ignore, msg->tailout_ignore);
  145. /* reserve an extra cache line */
  146. skb = dev_alloc_skb(msg->size + L1_CACHE_BYTES);
  147. if (!skb) {
  148. dev_err(xpnet, "failed on dev_alloc_skb(%d)\n",
  149. msg->size + L1_CACHE_BYTES);
  150. xpc_received(partid, channel, (void *)msg);
  151. xpnet_device->stats.rx_errors++;
  152. return;
  153. }
  154. /*
  155. * The allocated skb has some reserved space.
  156. * In order to use xp_remote_memcpy(), we need to get the
  157. * skb->data pointer moved forward.
  158. */
  159. skb_reserve(skb, (L1_CACHE_BYTES - ((u64)skb->data &
  160. (L1_CACHE_BYTES - 1)) +
  161. msg->leadin_ignore));
  162. /*
  163. * Update the tail pointer to indicate data actually
  164. * transferred.
  165. */
  166. skb_put(skb, (msg->size - msg->leadin_ignore - msg->tailout_ignore));
  167. /*
  168. * Move the data over from the other side.
  169. */
  170. if ((XPNET_VERSION_MINOR(msg->version) == 1) &&
  171. (msg->embedded_bytes != 0)) {
  172. dev_dbg(xpnet, "copying embedded message. memcpy(0x%p, 0x%p, "
  173. "%lu)\n", skb->data, &msg->data,
  174. (size_t)msg->embedded_bytes);
  175. skb_copy_to_linear_data(skb, &msg->data,
  176. (size_t)msg->embedded_bytes);
  177. } else {
  178. dst = (void *)((u64)skb->data & ~(L1_CACHE_BYTES - 1));
  179. dev_dbg(xpnet, "transferring buffer to the skb->data area;\n\t"
  180. "xp_remote_memcpy(0x%p, 0x%p, %hu)\n", dst,
  181. (void *)msg->buf_pa, msg->size);
  182. ret = xp_remote_memcpy(xp_pa(dst), msg->buf_pa, msg->size);
  183. if (ret != xpSuccess) {
  184. /*
  185. * !!! Need better way of cleaning skb. Currently skb
  186. * !!! appears in_use and we can't just call
  187. * !!! dev_kfree_skb.
  188. */
  189. dev_err(xpnet, "xp_remote_memcpy(0x%p, 0x%p, 0x%hx) "
  190. "returned error=0x%x\n", dst,
  191. (void *)msg->buf_pa, msg->size, ret);
  192. xpc_received(partid, channel, (void *)msg);
  193. xpnet_device->stats.rx_errors++;
  194. return;
  195. }
  196. }
  197. dev_dbg(xpnet, "<skb->head=0x%p skb->data=0x%p skb->tail=0x%p "
  198. "skb->end=0x%p skb->len=%d\n", (void *)skb->head,
  199. (void *)skb->data, skb_tail_pointer(skb), skb_end_pointer(skb),
  200. skb->len);
  201. skb->protocol = eth_type_trans(skb, xpnet_device);
  202. skb->ip_summed = CHECKSUM_UNNECESSARY;
  203. dev_dbg(xpnet, "passing skb to network layer\n"
  204. "\tskb->head=0x%p skb->data=0x%p skb->tail=0x%p "
  205. "skb->end=0x%p skb->len=%d\n",
  206. (void *)skb->head, (void *)skb->data, skb_tail_pointer(skb),
  207. skb_end_pointer(skb), skb->len);
  208. xpnet_device->stats.rx_packets++;
  209. xpnet_device->stats.rx_bytes += skb->len + ETH_HLEN;
  210. netif_rx_ni(skb);
  211. xpc_received(partid, channel, (void *)msg);
  212. }
  213. /*
  214. * This is the handler which XPC calls during any sort of change in
  215. * state or message reception on a connection.
  216. */
  217. static void
  218. xpnet_connection_activity(enum xp_retval reason, short partid, int channel,
  219. void *data, void *key)
  220. {
  221. DBUG_ON(partid < 0 || partid >= xp_max_npartitions);
  222. DBUG_ON(channel != XPC_NET_CHANNEL);
  223. switch (reason) {
  224. case xpMsgReceived: /* message received */
  225. DBUG_ON(data == NULL);
  226. xpnet_receive(partid, channel, (struct xpnet_message *)data);
  227. break;
  228. case xpConnected: /* connection completed to a partition */
  229. spin_lock_bh(&xpnet_broadcast_lock);
  230. __set_bit(partid, xpnet_broadcast_partitions);
  231. spin_unlock_bh(&xpnet_broadcast_lock);
  232. netif_carrier_on(xpnet_device);
  233. dev_dbg(xpnet, "%s connected to partition %d\n",
  234. xpnet_device->name, partid);
  235. break;
  236. default:
  237. spin_lock_bh(&xpnet_broadcast_lock);
  238. __clear_bit(partid, xpnet_broadcast_partitions);
  239. spin_unlock_bh(&xpnet_broadcast_lock);
  240. if (bitmap_empty((unsigned long *)xpnet_broadcast_partitions,
  241. xp_max_npartitions)) {
  242. netif_carrier_off(xpnet_device);
  243. }
  244. dev_dbg(xpnet, "%s disconnected from partition %d\n",
  245. xpnet_device->name, partid);
  246. break;
  247. }
  248. }
  249. static int
  250. xpnet_dev_open(struct net_device *dev)
  251. {
  252. enum xp_retval ret;
  253. dev_dbg(xpnet, "calling xpc_connect(%d, 0x%p, NULL, %ld, %ld, %ld, "
  254. "%ld)\n", XPC_NET_CHANNEL, xpnet_connection_activity,
  255. (unsigned long)XPNET_MSG_SIZE,
  256. (unsigned long)XPNET_MSG_NENTRIES,
  257. (unsigned long)XPNET_MAX_KTHREADS,
  258. (unsigned long)XPNET_MAX_IDLE_KTHREADS);
  259. ret = xpc_connect(XPC_NET_CHANNEL, xpnet_connection_activity, NULL,
  260. XPNET_MSG_SIZE, XPNET_MSG_NENTRIES,
  261. XPNET_MAX_KTHREADS, XPNET_MAX_IDLE_KTHREADS);
  262. if (ret != xpSuccess) {
  263. dev_err(xpnet, "ifconfig up of %s failed on XPC connect, "
  264. "ret=%d\n", dev->name, ret);
  265. return -ENOMEM;
  266. }
  267. dev_dbg(xpnet, "ifconfig up of %s; XPC connected\n", dev->name);
  268. return 0;
  269. }
  270. static int
  271. xpnet_dev_stop(struct net_device *dev)
  272. {
  273. xpc_disconnect(XPC_NET_CHANNEL);
  274. dev_dbg(xpnet, "ifconfig down of %s; XPC disconnected\n", dev->name);
  275. return 0;
  276. }
  277. /*
  278. * Notification that the other end has received the message and
  279. * DMA'd the skb information. At this point, they are done with
  280. * our side. When all recipients are done processing, we
  281. * release the skb and then release our pending message structure.
  282. */
  283. static void
  284. xpnet_send_completed(enum xp_retval reason, short partid, int channel,
  285. void *__qm)
  286. {
  287. struct xpnet_pending_msg *queued_msg = (struct xpnet_pending_msg *)__qm;
  288. DBUG_ON(queued_msg == NULL);
  289. dev_dbg(xpnet, "message to %d notified with reason %d\n",
  290. partid, reason);
  291. if (atomic_dec_return(&queued_msg->use_count) == 0) {
  292. dev_dbg(xpnet, "all acks for skb->head=-x%p\n",
  293. (void *)queued_msg->skb->head);
  294. dev_kfree_skb_any(queued_msg->skb);
  295. kfree(queued_msg);
  296. }
  297. }
  298. static void
  299. xpnet_send(struct sk_buff *skb, struct xpnet_pending_msg *queued_msg,
  300. u64 start_addr, u64 end_addr, u16 embedded_bytes, int dest_partid)
  301. {
  302. u8 msg_buffer[XPNET_MSG_SIZE];
  303. struct xpnet_message *msg = (struct xpnet_message *)&msg_buffer;
  304. u16 msg_size = sizeof(struct xpnet_message);
  305. enum xp_retval ret;
  306. msg->embedded_bytes = embedded_bytes;
  307. if (unlikely(embedded_bytes != 0)) {
  308. msg->version = XPNET_VERSION_EMBED;
  309. dev_dbg(xpnet, "calling memcpy(0x%p, 0x%p, 0x%lx)\n",
  310. &msg->data, skb->data, (size_t)embedded_bytes);
  311. skb_copy_from_linear_data(skb, &msg->data,
  312. (size_t)embedded_bytes);
  313. msg_size += embedded_bytes - 1;
  314. } else {
  315. msg->version = XPNET_VERSION;
  316. }
  317. msg->magic = XPNET_MAGIC;
  318. msg->size = end_addr - start_addr;
  319. msg->leadin_ignore = (u64)skb->data - start_addr;
  320. msg->tailout_ignore = end_addr - (u64)skb_tail_pointer(skb);
  321. msg->buf_pa = xp_pa((void *)start_addr);
  322. dev_dbg(xpnet, "sending XPC message to %d:%d\n"
  323. "msg->buf_pa=0x%lx, msg->size=%u, "
  324. "msg->leadin_ignore=%u, msg->tailout_ignore=%u\n",
  325. dest_partid, XPC_NET_CHANNEL, msg->buf_pa, msg->size,
  326. msg->leadin_ignore, msg->tailout_ignore);
  327. atomic_inc(&queued_msg->use_count);
  328. ret = xpc_send_notify(dest_partid, XPC_NET_CHANNEL, XPC_NOWAIT, msg,
  329. msg_size, xpnet_send_completed, queued_msg);
  330. if (unlikely(ret != xpSuccess))
  331. atomic_dec(&queued_msg->use_count);
  332. }
  333. /*
  334. * Network layer has formatted a packet (skb) and is ready to place it
  335. * "on the wire". Prepare and send an xpnet_message to all partitions
  336. * which have connected with us and are targets of this packet.
  337. *
  338. * MAC-NOTE: For the XPNET driver, the MAC address contains the
  339. * destination partid. If the destination partid octets are 0xffff,
  340. * this packet is to be broadcast to all connected partitions.
  341. */
  342. static netdev_tx_t
  343. xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
  344. {
  345. struct xpnet_pending_msg *queued_msg;
  346. u64 start_addr, end_addr;
  347. short dest_partid;
  348. u16 embedded_bytes = 0;
  349. dev_dbg(xpnet, ">skb->head=0x%p skb->data=0x%p skb->tail=0x%p "
  350. "skb->end=0x%p skb->len=%d\n", (void *)skb->head,
  351. (void *)skb->data, skb_tail_pointer(skb), skb_end_pointer(skb),
  352. skb->len);
  353. if (skb->data[0] == 0x33) {
  354. dev_kfree_skb(skb);
  355. return NETDEV_TX_OK; /* nothing needed to be done */
  356. }
  357. /*
  358. * The xpnet_pending_msg tracks how many outstanding
  359. * xpc_send_notifies are relying on this skb. When none
  360. * remain, release the skb.
  361. */
  362. queued_msg = kmalloc(sizeof(struct xpnet_pending_msg), GFP_ATOMIC);
  363. if (queued_msg == NULL) {
  364. dev_warn(xpnet, "failed to kmalloc %ld bytes; dropping "
  365. "packet\n", sizeof(struct xpnet_pending_msg));
  366. dev->stats.tx_errors++;
  367. dev_kfree_skb(skb);
  368. return NETDEV_TX_OK;
  369. }
  370. /* get the beginning of the first cacheline and end of last */
  371. start_addr = ((u64)skb->data & ~(L1_CACHE_BYTES - 1));
  372. end_addr = L1_CACHE_ALIGN((u64)skb_tail_pointer(skb));
  373. /* calculate how many bytes to embed in the XPC message */
  374. if (unlikely(skb->len <= XPNET_MSG_DATA_MAX)) {
  375. /* skb->data does fit so embed */
  376. embedded_bytes = skb->len;
  377. }
  378. /*
  379. * Since the send occurs asynchronously, we set the count to one
  380. * and begin sending. Any sends that happen to complete before
  381. * we are done sending will not free the skb. We will be left
  382. * with that task during exit. This also handles the case of
  383. * a packet destined for a partition which is no longer up.
  384. */
  385. atomic_set(&queued_msg->use_count, 1);
  386. queued_msg->skb = skb;
  387. if (skb->data[0] == 0xff) {
  388. /* we are being asked to broadcast to all partitions */
  389. for_each_set_bit(dest_partid, xpnet_broadcast_partitions,
  390. xp_max_npartitions) {
  391. xpnet_send(skb, queued_msg, start_addr, end_addr,
  392. embedded_bytes, dest_partid);
  393. }
  394. } else {
  395. dest_partid = (short)skb->data[XPNET_PARTID_OCTET + 1];
  396. dest_partid |= (short)skb->data[XPNET_PARTID_OCTET + 0] << 8;
  397. if (dest_partid >= 0 &&
  398. dest_partid < xp_max_npartitions &&
  399. test_bit(dest_partid, xpnet_broadcast_partitions) != 0) {
  400. xpnet_send(skb, queued_msg, start_addr, end_addr,
  401. embedded_bytes, dest_partid);
  402. }
  403. }
  404. dev->stats.tx_packets++;
  405. dev->stats.tx_bytes += skb->len;
  406. if (atomic_dec_return(&queued_msg->use_count) == 0) {
  407. dev_kfree_skb(skb);
  408. kfree(queued_msg);
  409. }
  410. return NETDEV_TX_OK;
  411. }
  412. /*
  413. * Deal with transmit timeouts coming from the network layer.
  414. */
  415. static void
  416. xpnet_dev_tx_timeout(struct net_device *dev)
  417. {
  418. dev->stats.tx_errors++;
  419. }
  420. static const struct net_device_ops xpnet_netdev_ops = {
  421. .ndo_open = xpnet_dev_open,
  422. .ndo_stop = xpnet_dev_stop,
  423. .ndo_start_xmit = xpnet_dev_hard_start_xmit,
  424. .ndo_tx_timeout = xpnet_dev_tx_timeout,
  425. .ndo_set_mac_address = eth_mac_addr,
  426. .ndo_validate_addr = eth_validate_addr,
  427. };
  428. static int __init
  429. xpnet_init(void)
  430. {
  431. int result;
  432. if (!is_shub() && !is_uv())
  433. return -ENODEV;
  434. dev_info(xpnet, "registering network device %s\n", XPNET_DEVICE_NAME);
  435. xpnet_broadcast_partitions = kcalloc(BITS_TO_LONGS(xp_max_npartitions),
  436. sizeof(long),
  437. GFP_KERNEL);
  438. if (xpnet_broadcast_partitions == NULL)
  439. return -ENOMEM;
  440. /*
  441. * use ether_setup() to init the majority of our device
  442. * structure and then override the necessary pieces.
  443. */
  444. xpnet_device = alloc_netdev(0, XPNET_DEVICE_NAME, NET_NAME_UNKNOWN,
  445. ether_setup);
  446. if (xpnet_device == NULL) {
  447. kfree(xpnet_broadcast_partitions);
  448. return -ENOMEM;
  449. }
  450. netif_carrier_off(xpnet_device);
  451. xpnet_device->netdev_ops = &xpnet_netdev_ops;
  452. xpnet_device->mtu = XPNET_DEF_MTU;
  453. xpnet_device->min_mtu = XPNET_MIN_MTU;
  454. xpnet_device->max_mtu = XPNET_MAX_MTU;
  455. /*
  456. * Multicast assumes the LSB of the first octet is set for multicast
  457. * MAC addresses. We chose the first octet of the MAC to be unlikely
  458. * to collide with any vendor's officially issued MAC.
  459. */
  460. xpnet_device->dev_addr[0] = 0x02; /* locally administered, no OUI */
  461. xpnet_device->dev_addr[XPNET_PARTID_OCTET + 1] = xp_partition_id;
  462. xpnet_device->dev_addr[XPNET_PARTID_OCTET + 0] = (xp_partition_id >> 8);
  463. /*
  464. * ether_setup() sets this to a multicast device. We are
  465. * really not supporting multicast at this time.
  466. */
  467. xpnet_device->flags &= ~IFF_MULTICAST;
  468. /*
  469. * No need to checksum as it is a DMA transfer. The BTE will
  470. * report an error if the data is not retrievable and the
  471. * packet will be dropped.
  472. */
  473. xpnet_device->features = NETIF_F_HW_CSUM;
  474. result = register_netdev(xpnet_device);
  475. if (result != 0) {
  476. free_netdev(xpnet_device);
  477. kfree(xpnet_broadcast_partitions);
  478. }
  479. return result;
  480. }
  481. module_init(xpnet_init);
  482. static void __exit
  483. xpnet_exit(void)
  484. {
  485. dev_info(xpnet, "unregistering network device %s\n",
  486. xpnet_device[0].name);
  487. unregister_netdev(xpnet_device);
  488. free_netdev(xpnet_device);
  489. kfree(xpnet_broadcast_partitions);
  490. }
  491. module_exit(xpnet_exit);
  492. MODULE_AUTHOR("Silicon Graphics, Inc.");
  493. MODULE_DESCRIPTION("Cross Partition Network adapter (XPNET)");
  494. MODULE_LICENSE("GPL");