Lines Matching refs:rnet

96 	struct rionet_private *rnet = netdev_priv(ndev);  in rionet_rx_clean()  local
99 i = rnet->rx_slot; in rionet_rx_clean()
102 if (!rnet->rx_skb[i]) in rionet_rx_clean()
105 if (!(data = rio_get_inb_message(rnet->mport, RIONET_MAILBOX))) in rionet_rx_clean()
108 rnet->rx_skb[i]->data = data; in rionet_rx_clean()
109 skb_put(rnet->rx_skb[i], RIO_MAX_MSG_SIZE); in rionet_rx_clean()
110 rnet->rx_skb[i]->protocol = in rionet_rx_clean()
111 eth_type_trans(rnet->rx_skb[i], ndev); in rionet_rx_clean()
112 error = __netif_rx(rnet->rx_skb[i]); in rionet_rx_clean()
121 } while ((i = (i + 1) % RIONET_RX_RING_SIZE) != rnet->rx_slot); in rionet_rx_clean()
129 struct rionet_private *rnet = netdev_priv(ndev); in rionet_rx_fill() local
131 i = rnet->rx_slot; in rionet_rx_fill()
133 rnet->rx_skb[i] = dev_alloc_skb(RIO_MAX_MSG_SIZE); in rionet_rx_fill()
135 if (!rnet->rx_skb[i]) in rionet_rx_fill()
138 rio_add_inb_buffer(rnet->mport, RIONET_MAILBOX, in rionet_rx_fill()
139 rnet->rx_skb[i]->data); in rionet_rx_fill()
142 rnet->rx_slot = i; in rionet_rx_fill()
148 struct rionet_private *rnet = netdev_priv(ndev); in rionet_queue_tx_msg() local
150 rio_add_outb_message(rnet->mport, rdev, 0, skb->data, skb->len); in rionet_queue_tx_msg()
151 rnet->tx_skb[rnet->tx_slot] = skb; in rionet_queue_tx_msg()
156 if (++rnet->tx_cnt == RIONET_TX_RING_SIZE) in rionet_queue_tx_msg()
159 ++rnet->tx_slot; in rionet_queue_tx_msg()
160 rnet->tx_slot &= (RIONET_TX_RING_SIZE - 1); in rionet_queue_tx_msg()
162 if (netif_msg_tx_queued(rnet)) in rionet_queue_tx_msg()
173 struct rionet_private *rnet = netdev_priv(ndev); in rionet_start_xmit() local
179 spin_lock_irqsave(&rnet->tx_lock, flags); in rionet_start_xmit()
182 add_num = nets[rnet->mport->id].nact; in rionet_start_xmit()
184 if ((rnet->tx_cnt + add_num) > RIONET_TX_RING_SIZE) { in rionet_start_xmit()
186 spin_unlock_irqrestore(&rnet->tx_lock, flags); in rionet_start_xmit()
195 for (i = 0; i < RIO_MAX_ROUTE_ENTRIES(rnet->mport->sys_size); in rionet_start_xmit()
197 if (nets[rnet->mport->id].active[i]) { in rionet_start_xmit()
199 nets[rnet->mport->id].active[i]); in rionet_start_xmit()
206 if (nets[rnet->mport->id].active[destid]) in rionet_start_xmit()
208 nets[rnet->mport->id].active[destid]); in rionet_start_xmit()
222 spin_unlock_irqrestore(&rnet->tx_lock, flags); in rionet_start_xmit()
231 struct rionet_private *rnet = netdev_priv(ndev); in rionet_dbell_event() local
233 unsigned char netid = rnet->mport->id; in rionet_dbell_event()
235 if (netif_msg_intr(rnet)) in rionet_dbell_event()
260 if (netif_msg_intr(rnet)) in rionet_dbell_event()
270 struct rionet_private *rnet = netdev_priv(ndev); in rionet_inb_msg_event() local
272 if (netif_msg_intr(rnet)) in rionet_inb_msg_event()
276 spin_lock(&rnet->lock); in rionet_inb_msg_event()
277 if ((n = rionet_rx_clean(ndev)) != rnet->rx_slot) in rionet_inb_msg_event()
279 spin_unlock(&rnet->lock); in rionet_inb_msg_event()
285 struct rionet_private *rnet = netdev_priv(ndev); in rionet_outb_msg_event() local
287 spin_lock(&rnet->tx_lock); in rionet_outb_msg_event()
289 if (netif_msg_intr(rnet)) in rionet_outb_msg_event()
294 while (rnet->tx_cnt && (rnet->ack_slot != slot)) { in rionet_outb_msg_event()
296 dev_kfree_skb_irq(rnet->tx_skb[rnet->ack_slot]); in rionet_outb_msg_event()
297 rnet->tx_skb[rnet->ack_slot] = NULL; in rionet_outb_msg_event()
298 ++rnet->ack_slot; in rionet_outb_msg_event()
299 rnet->ack_slot &= (RIONET_TX_RING_SIZE - 1); in rionet_outb_msg_event()
300 rnet->tx_cnt--; in rionet_outb_msg_event()
303 if (rnet->tx_cnt < RIONET_TX_RING_SIZE) in rionet_outb_msg_event()
306 spin_unlock(&rnet->tx_lock); in rionet_outb_msg_event()
313 struct rionet_private *rnet = netdev_priv(ndev); in rionet_open() local
314 unsigned char netid = rnet->mport->id; in rionet_open()
317 if (netif_msg_ifup(rnet)) in rionet_open()
320 if ((rc = rio_request_inb_dbell(rnet->mport, in rionet_open()
327 if ((rc = rio_request_inb_mbox(rnet->mport, in rionet_open()
334 if ((rc = rio_request_outb_mbox(rnet->mport, in rionet_open()
343 rnet->rx_skb[i] = NULL; in rionet_open()
344 rnet->rx_slot = 0; in rionet_open()
347 rnet->tx_slot = 0; in rionet_open()
348 rnet->tx_cnt = 0; in rionet_open()
349 rnet->ack_slot = 0; in rionet_open()
360 rnet->open = true; in rionet_open()
368 struct rionet_private *rnet = netdev_priv(ndev); in rionet_close() local
370 unsigned char netid = rnet->mport->id; in rionet_close()
374 if (netif_msg_ifup(rnet)) in rionet_close()
379 rnet->open = false; in rionet_close()
382 kfree_skb(rnet->rx_skb[i]); in rionet_close()
395 rio_release_inb_dbell(rnet->mport, RIONET_DOORBELL_JOIN, in rionet_close()
397 rio_release_inb_mbox(rnet->mport, RIONET_MAILBOX); in rionet_close()
398 rio_release_outb_mbox(rnet->mport, RIONET_MAILBOX); in rionet_close()
444 struct rionet_private *rnet = netdev_priv(ndev); in rionet_get_drvinfo() local
449 strscpy(info->bus_info, rnet->mport->name, sizeof(info->bus_info)); in rionet_get_drvinfo()
454 struct rionet_private *rnet = netdev_priv(ndev); in rionet_get_msglevel() local
456 return rnet->msg_enable; in rionet_get_msglevel()
461 struct rionet_private *rnet = netdev_priv(ndev); in rionet_set_msglevel() local
463 rnet->msg_enable = value; in rionet_set_msglevel()
484 struct rionet_private *rnet; in rionet_setup_netdev() local
499 rnet = netdev_priv(ndev); in rionet_setup_netdev()
500 rnet->mport = mport; in rionet_setup_netdev()
501 rnet->open = false; in rionet_setup_netdev()
522 spin_lock_init(&rnet->lock); in rionet_setup_netdev()
523 spin_lock_init(&rnet->tx_lock); in rionet_setup_netdev()
525 rnet->msg_enable = RIONET_DEFAULT_MSGLEVEL; in rionet_setup_netdev()
601 struct rionet_private *rnet; in rionet_add_dev() local
604 rnet = netdev_priv(nets[netid].ndev); in rionet_add_dev()
629 if (rnet->open) in rionet_add_dev()