• Home
  • Raw
  • Download

Lines Matching refs:ks

60 #define to_ks8851_spi(ks) container_of((ks), struct ks8851_net_spi, ks8851)  argument
82 static void ks8851_lock_spi(struct ks8851_net *ks, unsigned long *flags) in ks8851_lock_spi() argument
84 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_lock_spi()
96 static void ks8851_unlock_spi(struct ks8851_net *ks, unsigned long *flags) in ks8851_unlock_spi() argument
98 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_unlock_spi()
118 static void ks8851_wrreg16_spi(struct ks8851_net *ks, unsigned int reg, in ks8851_wrreg16_spi() argument
121 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_wrreg16_spi()
136 netdev_err(ks->netdev, "spi_sync() failed\n"); in ks8851_wrreg16_spi()
149 static void ks8851_rdreg(struct ks8851_net *ks, unsigned int op, in ks8851_rdreg() argument
152 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_rdreg()
155 __le16 *txb = (__le16 *)ks->txd; in ks8851_rdreg()
156 u8 *trx = ks->rxd; in ks8851_rdreg()
184 netdev_err(ks->netdev, "read: spi_sync() failed\n"); in ks8851_rdreg()
198 static unsigned int ks8851_rdreg16_spi(struct ks8851_net *ks, unsigned int reg) in ks8851_rdreg16_spi() argument
202 ks8851_rdreg(ks, MK_OP(reg & 2 ? 0xC : 0x3, reg), (u8 *)&rx, 2); in ks8851_rdreg16_spi()
215 static void ks8851_rdfifo_spi(struct ks8851_net *ks, u8 *buff, unsigned int len) in ks8851_rdfifo_spi() argument
217 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_rdfifo_spi()
223 netif_dbg(ks, rx_status, ks->netdev, in ks8851_rdfifo_spi()
240 netdev_err(ks->netdev, "%s: spi_sync() failed\n", __func__); in ks8851_rdfifo_spi()
254 static void ks8851_wrfifo_spi(struct ks8851_net *ks, struct sk_buff *txp, in ks8851_wrfifo_spi() argument
257 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_wrfifo_spi()
263 netif_dbg(ks, tx_queued, ks->netdev, "%s: skb %p, %d@%p, irq %d\n", in ks8851_wrfifo_spi()
266 fid = ks->fid++; in ks8851_wrfifo_spi()
273 ks->txh.txb[1] = KS_SPIOP_TXFIFO; in ks8851_wrfifo_spi()
274 ks->txh.txw[1] = cpu_to_le16(fid); in ks8851_wrfifo_spi()
275 ks->txh.txw[2] = cpu_to_le16(txp->len); in ks8851_wrfifo_spi()
277 xfer->tx_buf = &ks->txh.txb[1]; in ks8851_wrfifo_spi()
288 netdev_err(ks->netdev, "%s: spi_sync() failed\n", __func__); in ks8851_wrfifo_spi()
296 static void ks8851_rx_skb_spi(struct ks8851_net *ks, struct sk_buff *skb) in ks8851_rx_skb_spi() argument
311 struct ks8851_net *ks; in ks8851_tx_work() local
317 ks = &kss->ks8851; in ks8851_tx_work()
318 last = skb_queue_empty(&ks->txq); in ks8851_tx_work()
320 ks8851_lock_spi(ks, &flags); in ks8851_tx_work()
323 txb = skb_dequeue(&ks->txq); in ks8851_tx_work()
324 last = skb_queue_empty(&ks->txq); in ks8851_tx_work()
327 ks8851_wrreg16_spi(ks, KS_RXQCR, in ks8851_tx_work()
328 ks->rc_rxqcr | RXQCR_SDA); in ks8851_tx_work()
329 ks8851_wrfifo_spi(ks, txb, last); in ks8851_tx_work()
330 ks8851_wrreg16_spi(ks, KS_RXQCR, ks->rc_rxqcr); in ks8851_tx_work()
331 ks8851_wrreg16_spi(ks, KS_TXQCR, TXQCR_METFE); in ks8851_tx_work()
333 ks8851_done_tx(ks, txb); in ks8851_tx_work()
337 ks8851_unlock_spi(ks, &flags); in ks8851_tx_work()
344 static void ks8851_flush_tx_work_spi(struct ks8851_net *ks) in ks8851_flush_tx_work_spi() argument
346 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_flush_tx_work_spi()
380 struct ks8851_net *ks = netdev_priv(dev); in ks8851_start_xmit_spi() local
384 kss = to_ks8851_spi(ks); in ks8851_start_xmit_spi()
386 netif_dbg(ks, tx_queued, ks->netdev, in ks8851_start_xmit_spi()
389 spin_lock(&ks->statelock); in ks8851_start_xmit_spi()
391 if (needed > ks->tx_space) { in ks8851_start_xmit_spi()
395 ks->tx_space -= needed; in ks8851_start_xmit_spi()
396 skb_queue_tail(&ks->txq, skb); in ks8851_start_xmit_spi()
399 spin_unlock(&ks->statelock); in ks8851_start_xmit_spi()
410 struct ks8851_net *ks; in ks8851_probe_spi() local
418 ks = netdev_priv(netdev); in ks8851_probe_spi()
420 ks->lock = ks8851_lock_spi; in ks8851_probe_spi()
421 ks->unlock = ks8851_unlock_spi; in ks8851_probe_spi()
422 ks->rdreg16 = ks8851_rdreg16_spi; in ks8851_probe_spi()
423 ks->wrreg16 = ks8851_wrreg16_spi; in ks8851_probe_spi()
424 ks->rdfifo = ks8851_rdfifo_spi; in ks8851_probe_spi()
425 ks->wrfifo = ks8851_wrfifo_spi; in ks8851_probe_spi()
426 ks->start_xmit = ks8851_start_xmit_spi; in ks8851_probe_spi()
427 ks->rx_skb = ks8851_rx_skb_spi; in ks8851_probe_spi()
428 ks->flush_tx_work = ks8851_flush_tx_work_spi; in ks8851_probe_spi()
436 ks->rc_ier = STD_IRQ; in ks8851_probe_spi()
438 kss = to_ks8851_spi(ks); in ks8851_probe_spi()