• Home
  • Raw
  • Download

Lines Matching full:ks

58 #define to_ks8851_spi(ks) container_of((ks), struct ks8851_net_spi, ks8851)  argument
75 * @ks: The chip state
80 static void ks8851_lock_spi(struct ks8851_net *ks, unsigned long *flags) in ks8851_lock_spi() argument
82 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_lock_spi()
89 * @ks: The chip state
94 static void ks8851_unlock_spi(struct ks8851_net *ks, unsigned long *flags) in ks8851_unlock_spi() argument
96 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_unlock_spi()
110 * @ks: The chip state
116 static void ks8851_wrreg16_spi(struct ks8851_net *ks, unsigned int reg, in ks8851_wrreg16_spi() argument
119 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_wrreg16_spi()
134 netdev_err(ks->netdev, "spi_sync() failed\n"); in ks8851_wrreg16_spi()
139 * @ks: The device state
147 static void ks8851_rdreg(struct ks8851_net *ks, unsigned int op, in ks8851_rdreg() argument
150 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_rdreg()
153 __le16 *txb = (__le16 *)ks->txd; in ks8851_rdreg()
154 u8 *trx = ks->rxd; in ks8851_rdreg()
182 netdev_err(ks->netdev, "read: spi_sync() failed\n"); in ks8851_rdreg()
191 * @ks: The chip information
196 static unsigned int ks8851_rdreg16_spi(struct ks8851_net *ks, unsigned int reg) in ks8851_rdreg16_spi() argument
200 ks8851_rdreg(ks, MK_OP(reg & 2 ? 0xC : 0x3, reg), (u8 *)&rx, 2); in ks8851_rdreg16_spi()
206 * @ks: The device state.
213 static void ks8851_rdfifo_spi(struct ks8851_net *ks, u8 *buff, unsigned int len) in ks8851_rdfifo_spi() argument
215 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_rdfifo_spi()
221 netif_dbg(ks, rx_status, ks->netdev, in ks8851_rdfifo_spi()
238 netdev_err(ks->netdev, "%s: spi_sync() failed\n", __func__); in ks8851_rdfifo_spi()
243 * @ks: The device state.
252 static void ks8851_wrfifo_spi(struct ks8851_net *ks, struct sk_buff *txp, in ks8851_wrfifo_spi() argument
255 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_wrfifo_spi()
261 netif_dbg(ks, tx_queued, ks->netdev, "%s: skb %p, %d@%p, irq %d\n", in ks8851_wrfifo_spi()
264 fid = ks->fid++; in ks8851_wrfifo_spi()
271 ks->txh.txb[1] = KS_SPIOP_TXFIFO; in ks8851_wrfifo_spi()
272 ks->txh.txw[1] = cpu_to_le16(fid); in ks8851_wrfifo_spi()
273 ks->txh.txw[2] = cpu_to_le16(txp->len); in ks8851_wrfifo_spi()
275 xfer->tx_buf = &ks->txh.txb[1]; in ks8851_wrfifo_spi()
286 netdev_err(ks->netdev, "%s: spi_sync() failed\n", __func__); in ks8851_wrfifo_spi()
303 * @ks: The device state
306 static void ks8851_rx_skb_spi(struct ks8851_net *ks, struct sk_buff *skb) in ks8851_rx_skb_spi() argument
323 struct ks8851_net *ks; in ks8851_tx_work() local
329 ks = &kss->ks8851; in ks8851_tx_work()
330 last = skb_queue_empty(&ks->txq); in ks8851_tx_work()
332 ks8851_lock_spi(ks, &flags); in ks8851_tx_work()
335 txb = skb_dequeue(&ks->txq); in ks8851_tx_work()
336 last = skb_queue_empty(&ks->txq); in ks8851_tx_work()
341 ks8851_wrreg16_spi(ks, KS_RXQCR, in ks8851_tx_work()
342 ks->rc_rxqcr | RXQCR_SDA); in ks8851_tx_work()
343 ks8851_wrfifo_spi(ks, txb, last); in ks8851_tx_work()
344 ks8851_wrreg16_spi(ks, KS_RXQCR, ks->rc_rxqcr); in ks8851_tx_work()
345 ks8851_wrreg16_spi(ks, KS_TXQCR, TXQCR_METFE); in ks8851_tx_work()
347 ks8851_done_tx(ks, txb); in ks8851_tx_work()
351 tx_space = ks8851_rdreg16_spi(ks, KS_TXMIR); in ks8851_tx_work()
353 spin_lock(&ks->statelock); in ks8851_tx_work()
354 ks->queued_len -= dequeued_len; in ks8851_tx_work()
355 ks->tx_space = tx_space; in ks8851_tx_work()
356 spin_unlock(&ks->statelock); in ks8851_tx_work()
358 ks8851_unlock_spi(ks, &flags); in ks8851_tx_work()
363 * @ks: The device state
365 static void ks8851_flush_tx_work_spi(struct ks8851_net *ks) in ks8851_flush_tx_work_spi() argument
367 struct ks8851_net_spi *kss = to_ks8851_spi(ks); in ks8851_flush_tx_work_spi()
389 struct ks8851_net *ks = netdev_priv(dev); in ks8851_start_xmit_spi() local
393 kss = to_ks8851_spi(ks); in ks8851_start_xmit_spi()
395 netif_dbg(ks, tx_queued, ks->netdev, in ks8851_start_xmit_spi()
398 spin_lock(&ks->statelock); in ks8851_start_xmit_spi()
400 if (ks->queued_len + needed > ks->tx_space) { in ks8851_start_xmit_spi()
404 ks->queued_len += needed; in ks8851_start_xmit_spi()
405 skb_queue_tail(&ks->txq, skb); in ks8851_start_xmit_spi()
408 spin_unlock(&ks->statelock); in ks8851_start_xmit_spi()
420 struct ks8851_net *ks; in ks8851_probe_spi() local
429 ks = &kss->ks8851; in ks8851_probe_spi()
431 ks->lock = ks8851_lock_spi; in ks8851_probe_spi()
432 ks->unlock = ks8851_unlock_spi; in ks8851_probe_spi()
433 ks->rdreg16 = ks8851_rdreg16_spi; in ks8851_probe_spi()
434 ks->wrreg16 = ks8851_wrreg16_spi; in ks8851_probe_spi()
435 ks->rdfifo = ks8851_rdfifo_spi; in ks8851_probe_spi()
436 ks->wrfifo = ks8851_wrfifo_spi; in ks8851_probe_spi()
437 ks->start_xmit = ks8851_start_xmit_spi; in ks8851_probe_spi()
438 ks->rx_skb = ks8851_rx_skb_spi; in ks8851_probe_spi()
439 ks->flush_tx_work = ks8851_flush_tx_work_spi; in ks8851_probe_spi()
447 ks->rc_ier = STD_IRQ; in ks8851_probe_spi()