Lines Matching refs:odev

694 	struct hso_net *odev = netdev_priv(net);  in hso_net_open()  local
697 if (!odev) { in hso_net_open()
702 odev->skb_tx_buf = NULL; in hso_net_open()
705 spin_lock_irqsave(&odev->net_lock, flags); in hso_net_open()
706 odev->rx_parse_state = WAIT_IP; in hso_net_open()
707 odev->rx_buf_size = 0; in hso_net_open()
708 odev->rx_buf_missing = sizeof(struct iphdr); in hso_net_open()
709 spin_unlock_irqrestore(&odev->net_lock, flags); in hso_net_open()
712 set_bit(HSO_NET_RUNNING, &odev->flags); in hso_net_open()
713 hso_start_net_device(odev->parent); in hso_net_open()
724 struct hso_net *odev = netdev_priv(net); in hso_net_close() local
729 clear_bit(HSO_NET_RUNNING, &odev->flags); in hso_net_close()
731 hso_stop_net_device(odev->parent); in hso_net_close()
740 struct hso_net *odev = urb->context; in write_bulk_callback() local
744 if (!odev || !test_bit(HSO_NET_RUNNING, &odev->flags)) { in write_bulk_callback()
750 if (!netif_device_present(odev->net)) { in write_bulk_callback()
759 handle_usb_error(status, __func__, odev->parent); in write_bulk_callback()
761 hso_put_activity(odev->parent); in write_bulk_callback()
764 netif_wake_queue(odev->net); in write_bulk_callback()
771 struct hso_net *odev = netdev_priv(net); in hso_net_start_xmit() local
776 if (hso_get_activity(odev->parent) == -EAGAIN) { in hso_net_start_xmit()
777 odev->skb_tx_buf = skb; in hso_net_start_xmit()
784 memcpy(odev->mux_bulk_tx_buf, skb->data, skb->len); in hso_net_start_xmit()
788 usb_fill_bulk_urb(odev->mux_bulk_tx_urb, in hso_net_start_xmit()
789 odev->parent->usb, in hso_net_start_xmit()
790 usb_sndbulkpipe(odev->parent->usb, in hso_net_start_xmit()
791 odev->out_endp-> in hso_net_start_xmit()
793 odev->mux_bulk_tx_buf, skb->len, write_bulk_callback, in hso_net_start_xmit()
794 odev); in hso_net_start_xmit()
797 odev->mux_bulk_tx_urb->transfer_flags |= URB_ZERO_PACKET; in hso_net_start_xmit()
800 result = usb_submit_urb(odev->mux_bulk_tx_urb, GFP_ATOMIC); in hso_net_start_xmit()
802 dev_warn(&odev->parent->interface->dev, in hso_net_start_xmit()
822 struct hso_net *odev = netdev_priv(net); in hso_net_tx_timeout() local
824 if (!odev) in hso_net_tx_timeout()
831 if (odev->mux_bulk_tx_urb) in hso_net_tx_timeout()
832 usb_unlink_urb(odev->mux_bulk_tx_urb); in hso_net_tx_timeout()
839 static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt, in packetizeRx() argument
851 switch (odev->rx_parse_state) { in packetizeRx()
857 odev->rx_buf_missing) ? count : odev-> in packetizeRx()
860 memcpy(((unsigned char *)(&odev->rx_ip_hdr)) + in packetizeRx()
861 odev->rx_buf_size, ip_pkt + buffer_offset, in packetizeRx()
864 odev->rx_buf_size += temp_bytes; in packetizeRx()
866 odev->rx_buf_missing -= temp_bytes; in packetizeRx()
869 if (!odev->rx_buf_missing) { in packetizeRx()
872 frame_len = ntohs(odev->rx_ip_hdr.tot_len); in packetizeRx()
876 dev_err(&odev->net->dev, in packetizeRx()
879 odev->rx_parse_state = WAIT_SYNC; in packetizeRx()
883 odev->skb_rx_buf = netdev_alloc_skb(odev->net, in packetizeRx()
885 if (!odev->skb_rx_buf) { in packetizeRx()
888 odev->rx_parse_state = WAIT_SYNC; in packetizeRx()
894 skb_put_data(odev->skb_rx_buf, in packetizeRx()
895 (char *)&(odev->rx_ip_hdr), in packetizeRx()
899 odev->rx_buf_size = sizeof(struct iphdr); in packetizeRx()
902 odev->rx_buf_missing = in packetizeRx()
904 odev->rx_parse_state = WAIT_DATA; in packetizeRx()
909 temp_bytes = (count < odev->rx_buf_missing) in packetizeRx()
910 ? count : odev->rx_buf_missing; in packetizeRx()
915 skb_put_data(odev->skb_rx_buf, in packetizeRx()
919 odev->rx_buf_missing -= temp_bytes; in packetizeRx()
922 odev->rx_buf_size += temp_bytes; in packetizeRx()
923 if (!odev->rx_buf_missing) { in packetizeRx()
926 odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP); in packetizeRx()
927 skb_reset_mac_header(odev->skb_rx_buf); in packetizeRx()
930 netif_rx(odev->skb_rx_buf); in packetizeRx()
932 odev->skb_rx_buf = NULL; in packetizeRx()
935 odev->net->stats.rx_packets++; in packetizeRx()
937 odev->net->stats.rx_bytes += odev->rx_buf_size; in packetizeRx()
939 odev->rx_buf_size = 0; in packetizeRx()
940 odev->rx_buf_missing = sizeof(struct iphdr); in packetizeRx()
941 odev->rx_parse_state = WAIT_IP; in packetizeRx()
958 if (odev->rx_parse_state == WAIT_SYNC) { in packetizeRx()
959 odev->rx_parse_state = WAIT_IP; in packetizeRx()
960 odev->rx_buf_size = 0; in packetizeRx()
961 odev->rx_buf_missing = sizeof(struct iphdr); in packetizeRx()
981 struct hso_net *odev = urb->context; in read_bulk_callback() local
989 handle_usb_error(status, __func__, odev->parent); in read_bulk_callback()
994 if (!odev || !test_bit(HSO_NET_RUNNING, &odev->flags)) { in read_bulk_callback()
1000 net = odev->net; in read_bulk_callback()
1007 if (odev->parent->port_spec & HSO_INFO_CRC_BUG) in read_bulk_callback()
1008 fix_crc_bug(urb, odev->in_endp->wMaxPacketSize); in read_bulk_callback()
1014 spin_lock_irqsave(&odev->net_lock, flags); in read_bulk_callback()
1015 packetizeRx(odev, urb->transfer_buffer, urb->actual_length, in read_bulk_callback()
1018 spin_unlock_irqrestore(&odev->net_lock, flags); in read_bulk_callback()
1024 odev->parent->usb, in read_bulk_callback()
1025 usb_rcvbulkpipe(odev->parent->usb, in read_bulk_callback()
1026 odev->in_endp-> in read_bulk_callback()
1029 read_bulk_callback, odev); in read_bulk_callback()
1035 dev_warn(&odev->parent->interface->dev, in read_bulk_callback()