rapidio/rionet: add shutdown event handling
[deliverable/linux.git] / drivers / net / rionet.c
1 /*
2 * rionet - Ethernet driver over RapidIO messaging services
3 *
4 * Copyright 2005 MontaVista Software, Inc.
5 * Matt Porter <mporter@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <linux/dma-mapping.h>
16 #include <linux/delay.h>
17 #include <linux/rio.h>
18 #include <linux/rio_drv.h>
19 #include <linux/slab.h>
20 #include <linux/rio_ids.h>
21
22 #include <linux/netdevice.h>
23 #include <linux/etherdevice.h>
24 #include <linux/skbuff.h>
25 #include <linux/crc32.h>
26 #include <linux/ethtool.h>
27 #include <linux/reboot.h>
28
29 #define DRV_NAME "rionet"
30 #define DRV_VERSION "0.3"
31 #define DRV_AUTHOR "Matt Porter <mporter@kernel.crashing.org>"
32 #define DRV_DESC "Ethernet over RapidIO"
33
34 MODULE_AUTHOR(DRV_AUTHOR);
35 MODULE_DESCRIPTION(DRV_DESC);
36 MODULE_LICENSE("GPL");
37
38 #define RIONET_DEFAULT_MSGLEVEL \
39 (NETIF_MSG_DRV | \
40 NETIF_MSG_LINK | \
41 NETIF_MSG_RX_ERR | \
42 NETIF_MSG_TX_ERR)
43
44 #define RIONET_DOORBELL_JOIN 0x1000
45 #define RIONET_DOORBELL_LEAVE 0x1001
46
47 #define RIONET_MAILBOX 0
48
49 #define RIONET_TX_RING_SIZE CONFIG_RIONET_TX_SIZE
50 #define RIONET_RX_RING_SIZE CONFIG_RIONET_RX_SIZE
51 #define RIONET_MAX_NETS 8
52 #define RIONET_MSG_SIZE RIO_MAX_MSG_SIZE
53 #define RIONET_MAX_MTU (RIONET_MSG_SIZE - ETH_HLEN)
54
55 struct rionet_private {
56 struct rio_mport *mport;
57 struct sk_buff *rx_skb[RIONET_RX_RING_SIZE];
58 struct sk_buff *tx_skb[RIONET_TX_RING_SIZE];
59 int rx_slot;
60 int tx_slot;
61 int tx_cnt;
62 int ack_slot;
63 spinlock_t lock;
64 spinlock_t tx_lock;
65 u32 msg_enable;
66 };
67
68 struct rionet_peer {
69 struct list_head node;
70 struct rio_dev *rdev;
71 struct resource *res;
72 };
73
74 struct rionet_net {
75 struct net_device *ndev;
76 struct list_head peers;
77 struct rio_dev **active;
78 int nact; /* number of active peers */
79 };
80
81 static struct rionet_net nets[RIONET_MAX_NETS];
82
83 #define is_rionet_capable(src_ops, dst_ops) \
84 ((src_ops & RIO_SRC_OPS_DATA_MSG) && \
85 (dst_ops & RIO_DST_OPS_DATA_MSG) && \
86 (src_ops & RIO_SRC_OPS_DOORBELL) && \
87 (dst_ops & RIO_DST_OPS_DOORBELL))
88 #define dev_rionet_capable(dev) \
89 is_rionet_capable(dev->src_ops, dev->dst_ops)
90
91 #define RIONET_MAC_MATCH(x) (!memcmp((x), "\00\01\00\01", 4))
92 #define RIONET_GET_DESTID(x) ((*((u8 *)x + 4) << 8) | *((u8 *)x + 5))
93
94 static int rionet_rx_clean(struct net_device *ndev)
95 {
96 int i;
97 int error = 0;
98 struct rionet_private *rnet = netdev_priv(ndev);
99 void *data;
100
101 i = rnet->rx_slot;
102
103 do {
104 if (!rnet->rx_skb[i])
105 continue;
106
107 if (!(data = rio_get_inb_message(rnet->mport, RIONET_MAILBOX)))
108 break;
109
110 rnet->rx_skb[i]->data = data;
111 skb_put(rnet->rx_skb[i], RIO_MAX_MSG_SIZE);
112 rnet->rx_skb[i]->protocol =
113 eth_type_trans(rnet->rx_skb[i], ndev);
114 error = netif_rx(rnet->rx_skb[i]);
115
116 if (error == NET_RX_DROP) {
117 ndev->stats.rx_dropped++;
118 } else {
119 ndev->stats.rx_packets++;
120 ndev->stats.rx_bytes += RIO_MAX_MSG_SIZE;
121 }
122
123 } while ((i = (i + 1) % RIONET_RX_RING_SIZE) != rnet->rx_slot);
124
125 return i;
126 }
127
128 static void rionet_rx_fill(struct net_device *ndev, int end)
129 {
130 int i;
131 struct rionet_private *rnet = netdev_priv(ndev);
132
133 i = rnet->rx_slot;
134 do {
135 rnet->rx_skb[i] = dev_alloc_skb(RIO_MAX_MSG_SIZE);
136
137 if (!rnet->rx_skb[i])
138 break;
139
140 rio_add_inb_buffer(rnet->mport, RIONET_MAILBOX,
141 rnet->rx_skb[i]->data);
142 } while ((i = (i + 1) % RIONET_RX_RING_SIZE) != end);
143
144 rnet->rx_slot = i;
145 }
146
147 static int rionet_queue_tx_msg(struct sk_buff *skb, struct net_device *ndev,
148 struct rio_dev *rdev)
149 {
150 struct rionet_private *rnet = netdev_priv(ndev);
151
152 rio_add_outb_message(rnet->mport, rdev, 0, skb->data, skb->len);
153 rnet->tx_skb[rnet->tx_slot] = skb;
154
155 ndev->stats.tx_packets++;
156 ndev->stats.tx_bytes += skb->len;
157
158 if (++rnet->tx_cnt == RIONET_TX_RING_SIZE)
159 netif_stop_queue(ndev);
160
161 ++rnet->tx_slot;
162 rnet->tx_slot &= (RIONET_TX_RING_SIZE - 1);
163
164 if (netif_msg_tx_queued(rnet))
165 printk(KERN_INFO "%s: queued skb len %8.8x\n", DRV_NAME,
166 skb->len);
167
168 return 0;
169 }
170
171 static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
172 {
173 int i;
174 struct rionet_private *rnet = netdev_priv(ndev);
175 struct ethhdr *eth = (struct ethhdr *)skb->data;
176 u16 destid;
177 unsigned long flags;
178 int add_num = 1;
179
180 local_irq_save(flags);
181 if (!spin_trylock(&rnet->tx_lock)) {
182 local_irq_restore(flags);
183 return NETDEV_TX_LOCKED;
184 }
185
186 if (is_multicast_ether_addr(eth->h_dest))
187 add_num = nets[rnet->mport->id].nact;
188
189 if ((rnet->tx_cnt + add_num) > RIONET_TX_RING_SIZE) {
190 netif_stop_queue(ndev);
191 spin_unlock_irqrestore(&rnet->tx_lock, flags);
192 printk(KERN_ERR "%s: BUG! Tx Ring full when queue awake!\n",
193 ndev->name);
194 return NETDEV_TX_BUSY;
195 }
196
197 if (is_multicast_ether_addr(eth->h_dest)) {
198 int count = 0;
199
200 for (i = 0; i < RIO_MAX_ROUTE_ENTRIES(rnet->mport->sys_size);
201 i++)
202 if (nets[rnet->mport->id].active[i]) {
203 rionet_queue_tx_msg(skb, ndev,
204 nets[rnet->mport->id].active[i]);
205 if (count)
206 atomic_inc(&skb->users);
207 count++;
208 }
209 } else if (RIONET_MAC_MATCH(eth->h_dest)) {
210 destid = RIONET_GET_DESTID(eth->h_dest);
211 if (nets[rnet->mport->id].active[destid])
212 rionet_queue_tx_msg(skb, ndev,
213 nets[rnet->mport->id].active[destid]);
214 else {
215 /*
216 * If the target device was removed from the list of
217 * active peers but we still have TX packets targeting
218 * it just report sending a packet to the target
219 * (without actual packet transfer).
220 */
221 dev_kfree_skb_any(skb);
222 ndev->stats.tx_packets++;
223 ndev->stats.tx_bytes += skb->len;
224 }
225 }
226
227 spin_unlock_irqrestore(&rnet->tx_lock, flags);
228
229 return NETDEV_TX_OK;
230 }
231
232 static void rionet_dbell_event(struct rio_mport *mport, void *dev_id, u16 sid, u16 tid,
233 u16 info)
234 {
235 struct net_device *ndev = dev_id;
236 struct rionet_private *rnet = netdev_priv(ndev);
237 struct rionet_peer *peer;
238
239 if (netif_msg_intr(rnet))
240 printk(KERN_INFO "%s: doorbell sid %4.4x tid %4.4x info %4.4x",
241 DRV_NAME, sid, tid, info);
242 if (info == RIONET_DOORBELL_JOIN) {
243 if (!nets[rnet->mport->id].active[sid]) {
244 list_for_each_entry(peer,
245 &nets[rnet->mport->id].peers, node) {
246 if (peer->rdev->destid == sid) {
247 nets[rnet->mport->id].active[sid] =
248 peer->rdev;
249 nets[rnet->mport->id].nact++;
250 }
251 }
252 rio_mport_send_doorbell(mport, sid,
253 RIONET_DOORBELL_JOIN);
254 }
255 } else if (info == RIONET_DOORBELL_LEAVE) {
256 nets[rnet->mport->id].active[sid] = NULL;
257 nets[rnet->mport->id].nact--;
258 } else {
259 if (netif_msg_intr(rnet))
260 printk(KERN_WARNING "%s: unhandled doorbell\n",
261 DRV_NAME);
262 }
263 }
264
265 static void rionet_inb_msg_event(struct rio_mport *mport, void *dev_id, int mbox, int slot)
266 {
267 int n;
268 struct net_device *ndev = dev_id;
269 struct rionet_private *rnet = netdev_priv(ndev);
270
271 if (netif_msg_intr(rnet))
272 printk(KERN_INFO "%s: inbound message event, mbox %d slot %d\n",
273 DRV_NAME, mbox, slot);
274
275 spin_lock(&rnet->lock);
276 if ((n = rionet_rx_clean(ndev)) != rnet->rx_slot)
277 rionet_rx_fill(ndev, n);
278 spin_unlock(&rnet->lock);
279 }
280
281 static void rionet_outb_msg_event(struct rio_mport *mport, void *dev_id, int mbox, int slot)
282 {
283 struct net_device *ndev = dev_id;
284 struct rionet_private *rnet = netdev_priv(ndev);
285
286 spin_lock(&rnet->tx_lock);
287
288 if (netif_msg_intr(rnet))
289 printk(KERN_INFO
290 "%s: outbound message event, mbox %d slot %d\n",
291 DRV_NAME, mbox, slot);
292
293 while (rnet->tx_cnt && (rnet->ack_slot != slot)) {
294 /* dma unmap single */
295 dev_kfree_skb_irq(rnet->tx_skb[rnet->ack_slot]);
296 rnet->tx_skb[rnet->ack_slot] = NULL;
297 ++rnet->ack_slot;
298 rnet->ack_slot &= (RIONET_TX_RING_SIZE - 1);
299 rnet->tx_cnt--;
300 }
301
302 if (rnet->tx_cnt < RIONET_TX_RING_SIZE)
303 netif_wake_queue(ndev);
304
305 spin_unlock(&rnet->tx_lock);
306 }
307
308 static int rionet_open(struct net_device *ndev)
309 {
310 int i, rc = 0;
311 struct rionet_peer *peer, *tmp;
312 struct rionet_private *rnet = netdev_priv(ndev);
313
314 if (netif_msg_ifup(rnet))
315 printk(KERN_INFO "%s: open\n", DRV_NAME);
316
317 if ((rc = rio_request_inb_dbell(rnet->mport,
318 (void *)ndev,
319 RIONET_DOORBELL_JOIN,
320 RIONET_DOORBELL_LEAVE,
321 rionet_dbell_event)) < 0)
322 goto out;
323
324 if ((rc = rio_request_inb_mbox(rnet->mport,
325 (void *)ndev,
326 RIONET_MAILBOX,
327 RIONET_RX_RING_SIZE,
328 rionet_inb_msg_event)) < 0)
329 goto out;
330
331 if ((rc = rio_request_outb_mbox(rnet->mport,
332 (void *)ndev,
333 RIONET_MAILBOX,
334 RIONET_TX_RING_SIZE,
335 rionet_outb_msg_event)) < 0)
336 goto out;
337
338 /* Initialize inbound message ring */
339 for (i = 0; i < RIONET_RX_RING_SIZE; i++)
340 rnet->rx_skb[i] = NULL;
341 rnet->rx_slot = 0;
342 rionet_rx_fill(ndev, 0);
343
344 rnet->tx_slot = 0;
345 rnet->tx_cnt = 0;
346 rnet->ack_slot = 0;
347
348 netif_carrier_on(ndev);
349 netif_start_queue(ndev);
350
351 list_for_each_entry_safe(peer, tmp,
352 &nets[rnet->mport->id].peers, node) {
353 if (!(peer->res = rio_request_outb_dbell(peer->rdev,
354 RIONET_DOORBELL_JOIN,
355 RIONET_DOORBELL_LEAVE)))
356 {
357 printk(KERN_ERR "%s: error requesting doorbells\n",
358 DRV_NAME);
359 continue;
360 }
361
362 /* Send a join message */
363 rio_send_doorbell(peer->rdev, RIONET_DOORBELL_JOIN);
364 }
365
366 out:
367 return rc;
368 }
369
370 static int rionet_close(struct net_device *ndev)
371 {
372 struct rionet_private *rnet = netdev_priv(ndev);
373 struct rionet_peer *peer, *tmp;
374 int i;
375
376 if (netif_msg_ifup(rnet))
377 printk(KERN_INFO "%s: close %s\n", DRV_NAME, ndev->name);
378
379 netif_stop_queue(ndev);
380 netif_carrier_off(ndev);
381
382 for (i = 0; i < RIONET_RX_RING_SIZE; i++)
383 kfree_skb(rnet->rx_skb[i]);
384
385 list_for_each_entry_safe(peer, tmp,
386 &nets[rnet->mport->id].peers, node) {
387 if (nets[rnet->mport->id].active[peer->rdev->destid]) {
388 rio_send_doorbell(peer->rdev, RIONET_DOORBELL_LEAVE);
389 nets[rnet->mport->id].active[peer->rdev->destid] = NULL;
390 }
391 rio_release_outb_dbell(peer->rdev, peer->res);
392 }
393
394 rio_release_inb_dbell(rnet->mport, RIONET_DOORBELL_JOIN,
395 RIONET_DOORBELL_LEAVE);
396 rio_release_inb_mbox(rnet->mport, RIONET_MAILBOX);
397 rio_release_outb_mbox(rnet->mport, RIONET_MAILBOX);
398
399 return 0;
400 }
401
402 static void rionet_remove_dev(struct device *dev, struct subsys_interface *sif)
403 {
404 struct rio_dev *rdev = to_rio_dev(dev);
405 unsigned char netid = rdev->net->hport->id;
406 struct rionet_peer *peer, *tmp;
407
408 if (dev_rionet_capable(rdev)) {
409 list_for_each_entry_safe(peer, tmp, &nets[netid].peers, node) {
410 if (peer->rdev == rdev) {
411 if (nets[netid].active[rdev->destid]) {
412 nets[netid].active[rdev->destid] = NULL;
413 nets[netid].nact--;
414 }
415
416 list_del(&peer->node);
417 kfree(peer);
418 break;
419 }
420 }
421 }
422 }
423
424 static void rionet_get_drvinfo(struct net_device *ndev,
425 struct ethtool_drvinfo *info)
426 {
427 struct rionet_private *rnet = netdev_priv(ndev);
428
429 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
430 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
431 strlcpy(info->fw_version, "n/a", sizeof(info->fw_version));
432 strlcpy(info->bus_info, rnet->mport->name, sizeof(info->bus_info));
433 }
434
435 static u32 rionet_get_msglevel(struct net_device *ndev)
436 {
437 struct rionet_private *rnet = netdev_priv(ndev);
438
439 return rnet->msg_enable;
440 }
441
442 static void rionet_set_msglevel(struct net_device *ndev, u32 value)
443 {
444 struct rionet_private *rnet = netdev_priv(ndev);
445
446 rnet->msg_enable = value;
447 }
448
449 static int rionet_change_mtu(struct net_device *ndev, int new_mtu)
450 {
451 if ((new_mtu < 68) || (new_mtu > RIONET_MAX_MTU)) {
452 printk(KERN_ERR "%s: Invalid MTU size %d\n",
453 ndev->name, new_mtu);
454 return -EINVAL;
455 }
456 ndev->mtu = new_mtu;
457 return 0;
458 }
459
460 static const struct ethtool_ops rionet_ethtool_ops = {
461 .get_drvinfo = rionet_get_drvinfo,
462 .get_msglevel = rionet_get_msglevel,
463 .set_msglevel = rionet_set_msglevel,
464 .get_link = ethtool_op_get_link,
465 };
466
467 static const struct net_device_ops rionet_netdev_ops = {
468 .ndo_open = rionet_open,
469 .ndo_stop = rionet_close,
470 .ndo_start_xmit = rionet_start_xmit,
471 .ndo_change_mtu = rionet_change_mtu,
472 .ndo_validate_addr = eth_validate_addr,
473 .ndo_set_mac_address = eth_mac_addr,
474 };
475
476 static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev)
477 {
478 int rc = 0;
479 struct rionet_private *rnet;
480 u16 device_id;
481 const size_t rionet_active_bytes = sizeof(void *) *
482 RIO_MAX_ROUTE_ENTRIES(mport->sys_size);
483
484 nets[mport->id].active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
485 get_order(rionet_active_bytes));
486 if (!nets[mport->id].active) {
487 rc = -ENOMEM;
488 goto out;
489 }
490 memset((void *)nets[mport->id].active, 0, rionet_active_bytes);
491
492 /* Set up private area */
493 rnet = netdev_priv(ndev);
494 rnet->mport = mport;
495
496 /* Set the default MAC address */
497 device_id = rio_local_get_device_id(mport);
498 ndev->dev_addr[0] = 0x00;
499 ndev->dev_addr[1] = 0x01;
500 ndev->dev_addr[2] = 0x00;
501 ndev->dev_addr[3] = 0x01;
502 ndev->dev_addr[4] = device_id >> 8;
503 ndev->dev_addr[5] = device_id & 0xff;
504
505 ndev->netdev_ops = &rionet_netdev_ops;
506 ndev->mtu = RIONET_MAX_MTU;
507 ndev->features = NETIF_F_LLTX;
508 SET_NETDEV_DEV(ndev, &mport->dev);
509 ndev->ethtool_ops = &rionet_ethtool_ops;
510
511 spin_lock_init(&rnet->lock);
512 spin_lock_init(&rnet->tx_lock);
513
514 rnet->msg_enable = RIONET_DEFAULT_MSGLEVEL;
515
516 rc = register_netdev(ndev);
517 if (rc != 0)
518 goto out;
519
520 printk(KERN_INFO "%s: %s %s Version %s, MAC %pM, %s\n",
521 ndev->name,
522 DRV_NAME,
523 DRV_DESC,
524 DRV_VERSION,
525 ndev->dev_addr,
526 mport->name);
527
528 out:
529 return rc;
530 }
531
532 static unsigned long net_table[RIONET_MAX_NETS/sizeof(unsigned long) + 1];
533
534 static int rionet_add_dev(struct device *dev, struct subsys_interface *sif)
535 {
536 int rc = -ENODEV;
537 u32 lsrc_ops, ldst_ops;
538 struct rionet_peer *peer;
539 struct net_device *ndev = NULL;
540 struct rio_dev *rdev = to_rio_dev(dev);
541 unsigned char netid = rdev->net->hport->id;
542 int oldnet;
543
544 if (netid >= RIONET_MAX_NETS)
545 return rc;
546
547 oldnet = test_and_set_bit(netid, net_table);
548
549 /*
550 * If first time through this net, make sure local device is rionet
551 * capable and setup netdev (this step will be skipped in later probes
552 * on the same net).
553 */
554 if (!oldnet) {
555 rio_local_read_config_32(rdev->net->hport, RIO_SRC_OPS_CAR,
556 &lsrc_ops);
557 rio_local_read_config_32(rdev->net->hport, RIO_DST_OPS_CAR,
558 &ldst_ops);
559 if (!is_rionet_capable(lsrc_ops, ldst_ops)) {
560 printk(KERN_ERR
561 "%s: local device %s is not network capable\n",
562 DRV_NAME, rdev->net->hport->name);
563 goto out;
564 }
565
566 /* Allocate our net_device structure */
567 ndev = alloc_etherdev(sizeof(struct rionet_private));
568 if (ndev == NULL) {
569 rc = -ENOMEM;
570 goto out;
571 }
572 nets[netid].ndev = ndev;
573 rc = rionet_setup_netdev(rdev->net->hport, ndev);
574 if (rc) {
575 printk(KERN_ERR "%s: failed to setup netdev (rc=%d)\n",
576 DRV_NAME, rc);
577 goto out;
578 }
579
580 INIT_LIST_HEAD(&nets[netid].peers);
581 nets[netid].nact = 0;
582 } else if (nets[netid].ndev == NULL)
583 goto out;
584
585 /*
586 * If the remote device has mailbox/doorbell capabilities,
587 * add it to the peer list.
588 */
589 if (dev_rionet_capable(rdev)) {
590 if (!(peer = kmalloc(sizeof(struct rionet_peer), GFP_KERNEL))) {
591 rc = -ENOMEM;
592 goto out;
593 }
594 peer->rdev = rdev;
595 list_add_tail(&peer->node, &nets[netid].peers);
596 }
597
598 return 0;
599 out:
600 return rc;
601 }
602
603 static int rionet_shutdown(struct notifier_block *nb, unsigned long code,
604 void *unused)
605 {
606 struct rionet_peer *peer, *tmp;
607 int i;
608
609 pr_debug("%s: %s\n", DRV_NAME, __func__);
610
611 for (i = 0; i < RIONET_MAX_NETS; i++) {
612 if (!nets[i].ndev)
613 continue;
614
615 list_for_each_entry_safe(peer, tmp, &nets[i].peers, node) {
616 if (nets[i].active[peer->rdev->destid]) {
617 rio_send_doorbell(peer->rdev,
618 RIONET_DOORBELL_LEAVE);
619 nets[i].active[peer->rdev->destid] = NULL;
620 }
621 }
622 }
623
624 return NOTIFY_DONE;
625 }
626
627 #ifdef MODULE
628 static struct rio_device_id rionet_id_table[] = {
629 {RIO_DEVICE(RIO_ANY_ID, RIO_ANY_ID)},
630 { 0, } /* terminate list */
631 };
632
633 MODULE_DEVICE_TABLE(rapidio, rionet_id_table);
634 #endif
635
636 static struct subsys_interface rionet_interface = {
637 .name = "rionet",
638 .subsys = &rio_bus_type,
639 .add_dev = rionet_add_dev,
640 .remove_dev = rionet_remove_dev,
641 };
642
643 static struct notifier_block rionet_notifier = {
644 .notifier_call = rionet_shutdown,
645 };
646
647 static int __init rionet_init(void)
648 {
649 int ret;
650
651 ret = register_reboot_notifier(&rionet_notifier);
652 if (ret) {
653 pr_err("%s: failed to register reboot notifier (err=%d)\n",
654 DRV_NAME, ret);
655 return ret;
656 }
657 return subsys_interface_register(&rionet_interface);
658 }
659
660 static void __exit rionet_exit(void)
661 {
662 struct rionet_private *rnet;
663 struct net_device *ndev;
664 struct rionet_peer *peer, *tmp;
665 int i;
666
667 for (i = 0; i < RIONET_MAX_NETS; i++) {
668 if (nets[i].ndev != NULL) {
669 ndev = nets[i].ndev;
670 rnet = netdev_priv(ndev);
671 unregister_netdev(ndev);
672
673 list_for_each_entry_safe(peer,
674 tmp, &nets[i].peers, node) {
675 list_del(&peer->node);
676 kfree(peer);
677 }
678
679 free_pages((unsigned long)nets[i].active,
680 get_order(sizeof(void *) *
681 RIO_MAX_ROUTE_ENTRIES(rnet->mport->sys_size)));
682 nets[i].active = NULL;
683
684 free_netdev(ndev);
685 }
686 }
687
688 unregister_reboot_notifier(&rionet_notifier);
689 subsys_interface_unregister(&rionet_interface);
690 }
691
692 late_initcall(rionet_init);
693 module_exit(rionet_exit);
This page took 0.056127 seconds and 5 git commands to generate.