/** @brief print an IPC data @b WITH a @b LINK header @param layer the layer in the Samsung IPC @param ch the SIPC channel ID @param skb the pointer to a sk_buff instance */ inline void log_ipc_pkt(enum ipc_layer layer, u8 ch, struct sk_buff *skb) { /*struct io_device *iod;*/ if (unlikely(!skb)) { mif_err("ERR! NO skb!!!\n"); return; } /*iod = skbpriv(skb)->iod;*/ if (log_enabled(ch, layer)) pr_skb(layer_str(layer), skb); }
static int _usb_tx_work(struct sk_buff *skb) { struct sk_buff_head *txq; struct io_device *iod = skbpriv(skb)->iod; struct link_device *ld = skbpriv(skb)->ld; struct usb_link_device *usb_ld = to_usb_link_device(ld); struct if_usb_devdata *pipe_data; switch (iod->format) { case IPC_BOOT: case IPC_FMT: /* boot device uses same intf with fmt*/ pipe_data = &usb_ld->devdata[IF_USB_FMT_EP]; txq = &ld->sk_fmt_tx_q; break; case IPC_RAW: pipe_data = &usb_ld->devdata[IF_USB_RAW_EP]; txq = &ld->sk_raw_tx_q; break; case IPC_RFS: pipe_data = &usb_ld->devdata[IF_USB_RFS_EP]; txq = &ld->sk_fmt_tx_q; break; default: /* wrong packet, drop it */ pipe_data = NULL; txq = NULL; break; } if (!pipe_data) return -ENOENT; #if 0 if (iod->format == IPC_FMT && usb_ld->if_usb_is_main) pr_skb("IPC-TX", skb); #endif if (iod->format == IPC_RAW) mif_debug("TX[RAW]\n"); return usb_tx_urb_with_skb(usb_ld->usbdev, skb, pipe_data); }
static int _usb_tx_work(struct sk_buff *skb) { struct sk_buff_head *txq; struct io_device *iod = skbpriv(skb)->iod; struct link_device *ld = skbpriv(skb)->ld; struct usb_link_device *usb_ld = to_usb_link_device(ld); struct if_usb_devdata *pipe_data; int ret; switch (iod->format) { case IPC_BOOT: case IPC_FMT: /* boot device uses same intf with fmt*/ pipe_data = &usb_ld->devdata[IF_USB_FMT_EP]; txq = &ld->sk_fmt_tx_q; break; case IPC_RAW: pipe_data = &usb_ld->devdata[IF_USB_RAW_EP]; txq = &ld->sk_raw_tx_q; break; case IPC_RFS: pipe_data = &usb_ld->devdata[IF_USB_RFS_EP]; txq = &ld->sk_fmt_tx_q; break; default: /* wrong packet, drop it */ pipe_data = NULL; break; } if (!pipe_data) { dev_kfree_skb_any(skb); return -ENOENT; } if (iod->format == IPC_FMT && usb_ld->if_usb_is_main) pr_skb("IPC-TX", skb); if (iod->format == IPC_RAW) mif_debug("TX[RAW]\n"); if (iod->format == IPC_RFS) pr_skb("RFS-TX", skb); if (!usb_ld->if_usb_connected || !usb_ld->usbdev) return -ENODEV; usb_mark_last_busy(usb_ld->usbdev); ret = usb_tx_urb_with_skb(usb_ld->usbdev, skb, pipe_data); if (ret < 0) { if (ret == -ENODEV || ret == -ENOENT) { mif_err("link broken while in runtime active ..." " purge!\n"); return ret; } mif_err("usb_tx_urb_with_skb for iod(%d), ret=%d\n", iod->format, ret); skb_queue_head(txq, skb); queue_delayed_work(ld->tx_wq, &ld->tx_delayed_work, msecs_to_jiffies(20)); return ret; } return 0; }