Lines Matching full:card
49 int gelic_card_set_irq_mask(struct gelic_card *card, u64 mask) in gelic_card_set_irq_mask() argument
53 status = lv1_net_set_interrupt_mask(bus_id(card), dev_id(card), in gelic_card_set_irq_mask()
56 dev_info(ctodev(card), in gelic_card_set_irq_mask()
61 static void gelic_card_rx_irq_on(struct gelic_card *card) in gelic_card_rx_irq_on() argument
63 card->irq_mask |= GELIC_CARD_RXINT; in gelic_card_rx_irq_on()
64 gelic_card_set_irq_mask(card, card->irq_mask); in gelic_card_rx_irq_on()
66 static void gelic_card_rx_irq_off(struct gelic_card *card) in gelic_card_rx_irq_off() argument
68 card->irq_mask &= ~GELIC_CARD_RXINT; in gelic_card_rx_irq_off()
69 gelic_card_set_irq_mask(card, card->irq_mask); in gelic_card_rx_irq_off()
72 static void gelic_card_get_ether_port_status(struct gelic_card *card, in gelic_card_get_ether_port_status() argument
78 lv1_net_control(bus_id(card), dev_id(card), in gelic_card_get_ether_port_status()
81 &card->ether_port_status, &v2); in gelic_card_get_ether_port_status()
84 ether_netdev = card->netdev[GELIC_PORT_ETHERNET_0]; in gelic_card_get_ether_port_status()
85 if (card->ether_port_status & GELIC_LV1_ETHER_LINK_UP) in gelic_card_get_ether_port_status()
105 static int gelic_card_set_link_mode(struct gelic_card *card, int mode) in gelic_card_set_link_mode() argument
110 status = lv1_net_control(bus_id(card), dev_id(card), in gelic_card_set_link_mode()
119 card->link_mode = mode; in gelic_card_set_link_mode()
125 * @card: card structure
130 static void gelic_card_disable_txdmac(struct gelic_card *card) in gelic_card_disable_txdmac() argument
135 status = lv1_net_stop_tx_dma(bus_id(card), dev_id(card)); in gelic_card_disable_txdmac()
137 dev_err(ctodev(card), in gelic_card_disable_txdmac()
143 * @card: card structure
148 static void gelic_card_enable_rxdmac(struct gelic_card *card) in gelic_card_enable_rxdmac() argument
153 if (gelic_descr_get_status(card->rx_chain.head) != in gelic_card_enable_rxdmac()
156 be32_to_cpu(card->rx_chain.head->hw_regs.dmac_cmd_status)); in gelic_card_enable_rxdmac()
158 be32_to_cpu(card->rx_chain.head->hw_regs.next_descr_addr)); in gelic_card_enable_rxdmac()
160 card->rx_chain.head); in gelic_card_enable_rxdmac()
163 status = lv1_net_start_rx_dma(bus_id(card), dev_id(card), in gelic_card_enable_rxdmac()
164 card->rx_chain.head->link.cpu_addr, 0); in gelic_card_enable_rxdmac()
166 dev_info(ctodev(card), in gelic_card_enable_rxdmac()
172 * @card: card structure
177 static void gelic_card_disable_rxdmac(struct gelic_card *card) in gelic_card_disable_rxdmac() argument
182 status = lv1_net_stop_rx_dma(bus_id(card), dev_id(card)); in gelic_card_disable_rxdmac()
184 dev_err(ctodev(card), in gelic_card_disable_rxdmac()
213 * @card: card structure
220 static void gelic_card_reset_chain(struct gelic_card *card, in gelic_card_reset_chain() argument
238 void gelic_card_up(struct gelic_card *card) in gelic_card_up() argument
241 mutex_lock(&card->updown_lock); in gelic_card_up()
242 if (atomic_inc_return(&card->users) == 1) { in gelic_card_up()
245 gelic_card_set_irq_mask(card, card->irq_mask); in gelic_card_up()
247 gelic_card_enable_rxdmac(card); in gelic_card_up()
249 napi_enable(&card->napi); in gelic_card_up()
251 mutex_unlock(&card->updown_lock); in gelic_card_up()
255 void gelic_card_down(struct gelic_card *card) in gelic_card_down() argument
259 mutex_lock(&card->updown_lock); in gelic_card_down()
260 if (atomic_dec_if_positive(&card->users) == 0) { in gelic_card_down()
262 napi_disable(&card->napi); in gelic_card_down()
267 mask = card->irq_mask & (GELIC_CARD_WLAN_EVENT_RECEIVED | in gelic_card_down()
269 gelic_card_set_irq_mask(card, mask); in gelic_card_down()
271 gelic_card_disable_rxdmac(card); in gelic_card_down()
272 gelic_card_reset_chain(card, &card->rx_chain, in gelic_card_down()
273 card->descr + GELIC_NET_TX_DESCRIPTORS); in gelic_card_down()
275 gelic_card_disable_txdmac(card); in gelic_card_down()
277 mutex_unlock(&card->updown_lock); in gelic_card_down()
283 * @card: card structure
286 static void gelic_card_free_chain(struct gelic_card *card, in gelic_card_free_chain() argument
293 dma_unmap_single(ctodev(card), descr->link.cpu_addr, in gelic_card_free_chain()
302 * @card: card structure
312 static int gelic_card_init_chain(struct gelic_card *card, in gelic_card_init_chain() argument
327 descr->link.cpu_addr = dma_map_single(ctodev(card), descr, in gelic_card_init_chain()
330 if (dma_mapping_error(ctodev(card), descr->link.cpu_addr)) { in gelic_card_init_chain()
332 dma_unmap_single(ctodev(card), in gelic_card_init_chain()
364 * @card: card structure
375 static int gelic_descr_prepare_rx(struct gelic_card *card, in gelic_descr_prepare_rx() argument
385 dev_info(ctodev(card), "%s: ERROR status\n", __func__); in gelic_descr_prepare_rx()
394 descr->skb = netdev_alloc_skb(*card->netdev, rx_skb_size); in gelic_descr_prepare_rx()
405 cpu_addr = dma_map_single(ctodev(card), descr->skb->data, in gelic_descr_prepare_rx()
408 if (dma_mapping_error(ctodev(card), cpu_addr)) { in gelic_descr_prepare_rx()
411 dev_info(ctodev(card), in gelic_descr_prepare_rx()
427 * @card: card structure
430 static void gelic_card_release_rx_chain(struct gelic_card *card) in gelic_card_release_rx_chain() argument
432 struct gelic_descr *descr = card->rx_chain.head; in gelic_card_release_rx_chain()
436 dma_unmap_single(ctodev(card), in gelic_card_release_rx_chain()
448 } while (descr != card->rx_chain.head); in gelic_card_release_rx_chain()
453 * @card: card structure
459 static int gelic_card_fill_rx_chain(struct gelic_card *card) in gelic_card_fill_rx_chain() argument
461 struct gelic_descr *descr = card->rx_chain.head; in gelic_card_fill_rx_chain()
466 ret = gelic_descr_prepare_rx(card, descr); in gelic_card_fill_rx_chain()
471 } while (descr != card->rx_chain.head); in gelic_card_fill_rx_chain()
475 gelic_card_release_rx_chain(card); in gelic_card_fill_rx_chain()
481 * @card: card structure
485 static int gelic_card_alloc_rx_skbs(struct gelic_card *card) in gelic_card_alloc_rx_skbs() argument
489 chain = &card->rx_chain; in gelic_card_alloc_rx_skbs()
490 ret = gelic_card_fill_rx_chain(card); in gelic_card_alloc_rx_skbs()
491 chain->tail = card->rx_top->prev; /* point to the last */ in gelic_card_alloc_rx_skbs()
497 * @card: card structure
502 static void gelic_descr_release_tx(struct gelic_card *card, in gelic_descr_release_tx() argument
509 dma_unmap_single(ctodev(card), in gelic_descr_release_tx()
527 static void gelic_card_stop_queues(struct gelic_card *card) in gelic_card_stop_queues() argument
529 netif_stop_queue(card->netdev[GELIC_PORT_ETHERNET_0]); in gelic_card_stop_queues()
531 if (card->netdev[GELIC_PORT_WIRELESS]) in gelic_card_stop_queues()
532 netif_stop_queue(card->netdev[GELIC_PORT_WIRELESS]); in gelic_card_stop_queues()
534 static void gelic_card_wake_queues(struct gelic_card *card) in gelic_card_wake_queues() argument
536 netif_wake_queue(card->netdev[GELIC_PORT_ETHERNET_0]); in gelic_card_wake_queues()
538 if (card->netdev[GELIC_PORT_WIRELESS]) in gelic_card_wake_queues()
539 netif_wake_queue(card->netdev[GELIC_PORT_WIRELESS]); in gelic_card_wake_queues()
543 * @card: adapter structure
548 static void gelic_card_release_tx_chain(struct gelic_card *card, int stop) in gelic_card_release_tx_chain() argument
555 for (tx_chain = &card->tx_chain; in gelic_card_release_tx_chain()
565 dev_info(ctodev(card), in gelic_card_release_tx_chain()
587 gelic_descr_release_tx(card, tx_chain->tail); in gelic_card_release_tx_chain()
592 gelic_card_wake_queues(card); in gelic_card_release_tx_chain()
605 struct gelic_card *card = netdev_card(netdev); in gelic_net_set_multi() local
613 status = lv1_net_remove_multicast_address(bus_id(card), dev_id(card), in gelic_net_set_multi()
616 dev_err(ctodev(card), in gelic_net_set_multi()
620 status = lv1_net_add_multicast_address(bus_id(card), dev_id(card), in gelic_net_set_multi()
623 dev_err(ctodev(card), in gelic_net_set_multi()
629 status = lv1_net_add_multicast_address(bus_id(card), in gelic_net_set_multi()
630 dev_id(card), in gelic_net_set_multi()
633 dev_err(ctodev(card), in gelic_net_set_multi()
647 status = lv1_net_add_multicast_address(bus_id(card), in gelic_net_set_multi()
648 dev_id(card), in gelic_net_set_multi()
651 dev_err(ctodev(card), in gelic_net_set_multi()
665 struct gelic_card *card; in gelic_net_stop() local
672 card = netdev_card(netdev); in gelic_net_stop()
673 gelic_card_down(card); in gelic_net_stop()
681 * @card: device structure to get descriptor from
686 gelic_card_get_next_tx_descr(struct gelic_card *card) in gelic_card_get_next_tx_descr() argument
688 if (!card->tx_chain.head) in gelic_card_get_next_tx_descr()
691 if (card->tx_chain.tail != card->tx_chain.head->next && in gelic_card_get_next_tx_descr()
692 gelic_descr_get_status(card->tx_chain.head) == in gelic_card_get_next_tx_descr()
694 return card->tx_chain.head; in gelic_card_get_next_tx_descr()
767 * @card: card structure
774 static int gelic_descr_prepare_tx(struct gelic_card *card, in gelic_descr_prepare_tx() argument
780 if (card->vlan_required) { in gelic_descr_prepare_tx()
786 card->vlan[type].tx); in gelic_descr_prepare_tx()
792 buf = dma_map_single(ctodev(card), skb->data, skb->len, DMA_TO_DEVICE); in gelic_descr_prepare_tx()
794 if (dma_mapping_error(ctodev(card), buf)) { in gelic_descr_prepare_tx()
795 dev_err(ctodev(card), in gelic_descr_prepare_tx()
809 card->tx_chain.head = descr->next; in gelic_descr_prepare_tx()
815 * @card: card structure
819 static int gelic_card_kick_txdma(struct gelic_card *card, in gelic_card_kick_txdma() argument
824 if (card->tx_dma_progress) in gelic_card_kick_txdma()
828 card->tx_dma_progress = 1; in gelic_card_kick_txdma()
829 status = lv1_net_start_tx_dma(bus_id(card), dev_id(card), in gelic_card_kick_txdma()
832 card->tx_dma_progress = 0; in gelic_card_kick_txdma()
833 dev_info(ctodev(card), "lv1_net_start_txdma failed," \ in gelic_card_kick_txdma()
849 struct gelic_card *card = netdev_card(netdev); in gelic_net_xmit() local
854 spin_lock_irqsave(&card->tx_lock, flags); in gelic_net_xmit()
856 gelic_card_release_tx_chain(card, 0); in gelic_net_xmit()
858 descr = gelic_card_get_next_tx_descr(card); in gelic_net_xmit()
863 gelic_card_stop_queues(card); in gelic_net_xmit()
864 spin_unlock_irqrestore(&card->tx_lock, flags); in gelic_net_xmit()
868 result = gelic_descr_prepare_tx(card, descr, skb); in gelic_net_xmit()
876 spin_unlock_irqrestore(&card->tx_lock, flags); in gelic_net_xmit()
890 if (gelic_card_kick_txdma(card, descr)) { in gelic_net_xmit()
898 gelic_descr_release_tx(card, descr); in gelic_net_xmit()
900 card->tx_chain.head = descr; in gelic_net_xmit()
903 dev_info(ctodev(card), "%s: kick failure\n", __func__); in gelic_net_xmit()
906 spin_unlock_irqrestore(&card->tx_lock, flags); in gelic_net_xmit()
913 * @card: card structure
920 struct gelic_card *card, in gelic_net_pass_skb_up() argument
930 dma_unmap_single(ctodev(card), in gelic_net_pass_skb_up()
938 dev_info(ctodev(card), "buffer full %x %x %x\n", in gelic_net_pass_skb_up()
945 * the card put 2 bytes vlan tag in front in gelic_net_pass_skb_up()
971 * @card: card structure
978 static int gelic_card_decode_one_descr(struct gelic_card *card) in gelic_card_decode_one_descr() argument
981 struct gelic_descr_chain *chain = &card->rx_chain; in gelic_card_decode_one_descr()
992 dev_dbg(ctodev(card), "dormant descr? %p\n", descr); in gelic_card_decode_one_descr()
997 if (card->vlan_required) { in gelic_card_decode_one_descr()
1002 if (card->vlan[i].rx == vid) { in gelic_card_decode_one_descr()
1003 netdev = card->netdev[i]; in gelic_card_decode_one_descr()
1012 netdev = card->netdev[GELIC_PORT_ETHERNET_0]; in gelic_card_decode_one_descr()
1017 dev_info(ctodev(card), "dropping RX descriptor with state %x\n", in gelic_card_decode_one_descr()
1033 dev_info(ctodev(card), "overlength frame\n"); in gelic_card_decode_one_descr()
1041 dev_dbg(ctodev(card), "RX descriptor with state %x\n", in gelic_card_decode_one_descr()
1047 gelic_net_pass_skb_up(descr, card, netdev); in gelic_card_decode_one_descr()
1068 gelic_descr_prepare_rx(card, descr); in gelic_card_decode_one_descr()
1085 gelic_card_enable_rxdmac(card); in gelic_card_decode_one_descr()
1100 struct gelic_card *card = container_of(napi, struct gelic_card, napi); in gelic_net_poll() local
1104 if (!gelic_card_decode_one_descr(card)) in gelic_net_poll()
1112 gelic_card_rx_irq_on(card); in gelic_net_poll()
1123 struct gelic_card *card = ptr; in gelic_card_interrupt() local
1126 status = card->irq_status; in gelic_card_interrupt()
1131 status &= card->irq_mask; in gelic_card_interrupt()
1134 gelic_card_rx_irq_off(card); in gelic_card_interrupt()
1135 napi_schedule(&card->napi); in gelic_card_interrupt()
1139 spin_lock_irqsave(&card->tx_lock, flags); in gelic_card_interrupt()
1140 card->tx_dma_progress = 0; in gelic_card_interrupt()
1141 gelic_card_release_tx_chain(card, 0); in gelic_card_interrupt()
1143 gelic_card_kick_txdma(card, card->tx_chain.tail); in gelic_card_interrupt()
1144 spin_unlock_irqrestore(&card->tx_lock, flags); in gelic_card_interrupt()
1149 gelic_card_get_ether_port_status(card, 1); in gelic_card_interrupt()
1154 gelic_wl_interrupt(card->netdev[GELIC_PORT_WIRELESS], status); in gelic_card_interrupt()
1169 struct gelic_card *card = netdev_card(netdev); in gelic_net_poll_controller() local
1171 gelic_card_set_irq_mask(card, 0); in gelic_net_poll_controller()
1173 gelic_card_set_irq_mask(card, card->irq_mask); in gelic_net_poll_controller()
1188 struct gelic_card *card = netdev_card(netdev); in gelic_net_open() local
1190 dev_dbg(ctodev(card), " -> %s %p\n", __func__, netdev); in gelic_net_open()
1192 gelic_card_up(card); in gelic_net_open()
1195 gelic_card_get_ether_port_status(card, 1); in gelic_net_open()
1197 dev_dbg(ctodev(card), " <- %s\n", __func__); in gelic_net_open()
1211 struct gelic_card *card = netdev_card(netdev); in gelic_ether_get_link_ksettings() local
1214 gelic_card_get_ether_port_status(card, 0); in gelic_ether_get_link_ksettings()
1216 if (card->ether_port_status & GELIC_LV1_ETHER_FULL_DUPLEX) in gelic_ether_get_link_ksettings()
1221 switch (card->ether_port_status & GELIC_LV1_ETHER_SPEED_MASK) { in gelic_ether_get_link_ksettings()
1242 if (card->link_mode & GELIC_LV1_ETHER_AUTO_NEG) { in gelic_ether_get_link_ksettings()
1262 struct gelic_card *card = netdev_card(netdev); in gelic_ether_set_link_ksettings() local
1290 ret = gelic_card_set_link_mode(card, mode); in gelic_ether_set_link_ksettings()
1313 struct gelic_card *card; in gelic_net_set_wol() local
1323 card = netdev_card(netdev); in gelic_net_set_wol()
1325 status = lv1_net_control(bus_id(card), dev_id(card), in gelic_net_set_wol()
1336 status = lv1_net_control(bus_id(card), dev_id(card), in gelic_net_set_wol()
1349 status = lv1_net_control(bus_id(card), dev_id(card), in gelic_net_set_wol()
1360 status = lv1_net_control(bus_id(card), dev_id(card), in gelic_net_set_wol()
1395 struct gelic_card *card = in gelic_net_tx_timeout_task() local
1397 struct net_device *netdev = card->netdev[GELIC_PORT_ETHERNET_0]; in gelic_net_tx_timeout_task()
1399 dev_info(ctodev(card), "%s:Timed out. Restarting...\n", __func__); in gelic_net_tx_timeout_task()
1411 atomic_dec(&card->tx_timeout_task_counter); in gelic_net_tx_timeout_task()
1423 struct gelic_card *card; in gelic_net_tx_timeout() local
1425 card = netdev_card(netdev); in gelic_net_tx_timeout()
1426 atomic_inc(&card->tx_timeout_task_counter); in gelic_net_tx_timeout()
1428 schedule_work(&card->tx_timeout_task); in gelic_net_tx_timeout()
1430 atomic_dec(&card->tx_timeout_task_counter); in gelic_net_tx_timeout()
1466 * @card: card structure
1473 int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card) in gelic_net_setup_netdev() argument
1484 status = lv1_net_control(bus_id(card), dev_id(card), in gelic_net_setup_netdev()
1489 dev_info(ctodev(card), in gelic_net_setup_netdev()
1496 if (card->vlan_required) { in gelic_net_setup_netdev()
1511 dev_err(ctodev(card), "%s:Couldn't register %s %d\n", in gelic_net_setup_netdev()
1515 dev_info(ctodev(card), "%s: MAC addr %pM\n", in gelic_net_setup_netdev()
1524 * gelic_alloc_card_net - allocates net_device and card structure
1527 * returns the card structure or NULL in case of errors
1529 * the card and net_device structures are linked to each other
1533 struct gelic_card *card; in gelic_alloc_card_net() local
1552 card = PTR_ALIGN(p, GELIC_ALIGN); in gelic_alloc_card_net()
1553 card->unalign = p; in gelic_alloc_card_net()
1560 kfree(card->unalign); in gelic_alloc_card_net()
1567 port->card = card; in gelic_alloc_card_net()
1571 card->netdev[GELIC_PORT_ETHERNET_0] = *netdev; in gelic_alloc_card_net()
1573 INIT_WORK(&card->tx_timeout_task, gelic_net_tx_timeout_task); in gelic_alloc_card_net()
1574 init_waitqueue_head(&card->waitq); in gelic_alloc_card_net()
1575 atomic_set(&card->tx_timeout_task_counter, 0); in gelic_alloc_card_net()
1576 mutex_init(&card->updown_lock); in gelic_alloc_card_net()
1577 atomic_set(&card->users, 0); in gelic_alloc_card_net()
1579 return card; in gelic_alloc_card_net()
1582 static void gelic_card_get_vlan_info(struct gelic_card *card) in gelic_card_get_vlan_info() argument
1603 status = lv1_net_control(bus_id(card), dev_id(card), in gelic_card_get_vlan_info()
1609 dev_dbg(ctodev(card), in gelic_card_get_vlan_info()
1612 card->vlan[i].tx = 0; in gelic_card_get_vlan_info()
1613 card->vlan[i].rx = 0; in gelic_card_get_vlan_info()
1616 card->vlan[i].tx = (u16)v1; in gelic_card_get_vlan_info()
1619 status = lv1_net_control(bus_id(card), dev_id(card), in gelic_card_get_vlan_info()
1625 dev_info(ctodev(card), in gelic_card_get_vlan_info()
1628 card->vlan[i].tx = 0; in gelic_card_get_vlan_info()
1629 card->vlan[i].rx = 0; in gelic_card_get_vlan_info()
1632 card->vlan[i].rx = (u16)v1; in gelic_card_get_vlan_info()
1634 dev_dbg(ctodev(card), "vlan_id[%d] tx=%02x rx=%02x\n", in gelic_card_get_vlan_info()
1635 i, card->vlan[i].tx, card->vlan[i].rx); in gelic_card_get_vlan_info()
1638 if (card->vlan[GELIC_PORT_ETHERNET_0].tx) { in gelic_card_get_vlan_info()
1639 BUG_ON(!card->vlan[GELIC_PORT_WIRELESS].tx); in gelic_card_get_vlan_info()
1640 card->vlan_required = 1; in gelic_card_get_vlan_info()
1642 card->vlan_required = 0; in gelic_card_get_vlan_info()
1646 card->vlan[GELIC_PORT_WIRELESS].tx = 0; in gelic_card_get_vlan_info()
1647 card->vlan[GELIC_PORT_WIRELESS].rx = 0; in gelic_card_get_vlan_info()
1650 dev_info(ctodev(card), "internal vlan %s\n", in gelic_card_get_vlan_info()
1651 card->vlan_required? "enabled" : "disabled"); in gelic_card_get_vlan_info()
1658 struct gelic_card *card; in ps3_gelic_driver_probe() local
1683 /* alloc card/netdevice */ in ps3_gelic_driver_probe()
1684 card = gelic_alloc_card_net(&netdev); in ps3_gelic_driver_probe()
1685 if (!card) { in ps3_gelic_driver_probe()
1691 ps3_system_bus_set_drvdata(dev, card); in ps3_gelic_driver_probe()
1692 card->dev = dev; in ps3_gelic_driver_probe()
1695 gelic_card_get_vlan_info(card); in ps3_gelic_driver_probe()
1697 card->link_mode = GELIC_LV1_ETHER_AUTO_NEG; in ps3_gelic_driver_probe()
1700 result = lv1_net_set_interrupt_status_indicator(bus_id(card), in ps3_gelic_driver_probe()
1701 dev_id(card), in ps3_gelic_driver_probe()
1702 ps3_mm_phys_to_lpar(__pa(&card->irq_status)), in ps3_gelic_driver_probe()
1714 &card->irq); in ps3_gelic_driver_probe()
1717 dev_info(ctodev(card), in ps3_gelic_driver_probe()
1723 result = request_irq(card->irq, gelic_card_interrupt, in ps3_gelic_driver_probe()
1724 0, netdev->name, card); in ps3_gelic_driver_probe()
1727 dev_info(ctodev(card), "%s:request_irq failed (%d)\n", in ps3_gelic_driver_probe()
1732 /* setup card structure */ in ps3_gelic_driver_probe()
1733 card->irq_mask = GELIC_CARD_RXINT | GELIC_CARD_TXINT | in ps3_gelic_driver_probe()
1737 result = gelic_card_init_chain(card, &card->tx_chain, in ps3_gelic_driver_probe()
1738 card->descr, GELIC_NET_TX_DESCRIPTORS); in ps3_gelic_driver_probe()
1741 result = gelic_card_init_chain(card, &card->rx_chain, in ps3_gelic_driver_probe()
1742 card->descr + GELIC_NET_TX_DESCRIPTORS, in ps3_gelic_driver_probe()
1748 card->tx_top = card->tx_chain.head; in ps3_gelic_driver_probe()
1749 card->rx_top = card->rx_chain.head; in ps3_gelic_driver_probe()
1750 dev_dbg(ctodev(card), "descr rx %p, tx %p, size %#lx, num %#x\n", in ps3_gelic_driver_probe()
1751 card->rx_top, card->tx_top, sizeof(struct gelic_descr), in ps3_gelic_driver_probe()
1754 result = gelic_card_alloc_rx_skbs(card); in ps3_gelic_driver_probe()
1758 spin_lock_init(&card->tx_lock); in ps3_gelic_driver_probe()
1759 card->tx_dma_progress = 0; in ps3_gelic_driver_probe()
1762 netdev->irq = card->irq; in ps3_gelic_driver_probe()
1763 SET_NETDEV_DEV(netdev, &card->dev->core); in ps3_gelic_driver_probe()
1764 gelic_ether_setup_netdev_ops(netdev, &card->napi); in ps3_gelic_driver_probe()
1765 result = gelic_net_setup_netdev(netdev, card); in ps3_gelic_driver_probe()
1773 result = gelic_wl_driver_probe(card); in ps3_gelic_driver_probe()
1784 gelic_card_free_chain(card, card->rx_chain.head); in ps3_gelic_driver_probe()
1786 gelic_card_free_chain(card, card->tx_chain.head); in ps3_gelic_driver_probe()
1788 free_irq(card->irq, card); in ps3_gelic_driver_probe()
1791 ps3_sb_event_receive_port_destroy(dev, card->irq); in ps3_gelic_driver_probe()
1793 lv1_net_set_interrupt_status_indicator(bus_id(card), in ps3_gelic_driver_probe()
1794 bus_id(card), in ps3_gelic_driver_probe()
1814 struct gelic_card *card = ps3_system_bus_get_drvdata(dev); in ps3_gelic_driver_remove() local
1819 gelic_card_set_link_mode(card, GELIC_LV1_ETHER_AUTO_NEG); in ps3_gelic_driver_remove()
1822 gelic_wl_driver_remove(card); in ps3_gelic_driver_remove()
1825 gelic_card_set_irq_mask(card, 0); in ps3_gelic_driver_remove()
1828 gelic_card_disable_rxdmac(card); in ps3_gelic_driver_remove()
1829 gelic_card_disable_txdmac(card); in ps3_gelic_driver_remove()
1832 gelic_card_release_tx_chain(card, 1); in ps3_gelic_driver_remove()
1833 gelic_card_release_rx_chain(card); in ps3_gelic_driver_remove()
1835 gelic_card_free_chain(card, card->tx_top); in ps3_gelic_driver_remove()
1836 gelic_card_free_chain(card, card->rx_top); in ps3_gelic_driver_remove()
1838 netdev0 = card->netdev[GELIC_PORT_ETHERNET_0]; in ps3_gelic_driver_remove()
1840 free_irq(card->irq, card); in ps3_gelic_driver_remove()
1842 ps3_sb_event_receive_port_destroy(card->dev, card->irq); in ps3_gelic_driver_remove()
1844 wait_event(card->waitq, in ps3_gelic_driver_remove()
1845 atomic_read(&card->tx_timeout_task_counter) == 0); in ps3_gelic_driver_remove()
1847 lv1_net_set_interrupt_status_indicator(bus_id(card), dev_id(card), in ps3_gelic_driver_remove()