Lines Matching defs:odev

696 	struct hso_net *odev = netdev_priv(net);
699 if (!odev) {
704 odev->skb_tx_buf = NULL;
707 spin_lock_irqsave(&odev->net_lock, flags);
708 odev->rx_parse_state = WAIT_IP;
709 odev->rx_buf_size = 0;
710 odev->rx_buf_missing = sizeof(struct iphdr);
711 spin_unlock_irqrestore(&odev->net_lock, flags);
714 set_bit(HSO_NET_RUNNING, &odev->flags);
715 hso_start_net_device(odev->parent);
726 struct hso_net *odev = netdev_priv(net);
731 clear_bit(HSO_NET_RUNNING, &odev->flags);
733 hso_stop_net_device(odev->parent);
742 struct hso_net *odev = urb->context;
746 if (!odev || !test_bit(HSO_NET_RUNNING, &odev->flags)) {
752 if (!netif_device_present(odev->net)) {
761 handle_usb_error(status, __func__, odev->parent);
763 hso_put_activity(odev->parent);
766 netif_wake_queue(odev->net);
773 struct hso_net *odev = netdev_priv(net);
778 if (hso_get_activity(odev->parent) == -EAGAIN) {
779 odev->skb_tx_buf = skb;
786 memcpy(odev->mux_bulk_tx_buf, skb->data, skb->len);
790 usb_fill_bulk_urb(odev->mux_bulk_tx_urb,
791 odev->parent->usb,
792 usb_sndbulkpipe(odev->parent->usb,
793 odev->out_endp->
795 odev->mux_bulk_tx_buf, skb->len, write_bulk_callback,
796 odev);
799 odev->mux_bulk_tx_urb->transfer_flags |= URB_ZERO_PACKET;
802 result = usb_submit_urb(odev->mux_bulk_tx_urb, GFP_ATOMIC);
804 dev_warn(&odev->parent->interface->dev,
824 struct hso_net *odev = netdev_priv(net);
826 if (!odev)
833 if (odev->mux_bulk_tx_urb)
834 usb_unlink_urb(odev->mux_bulk_tx_urb);
841 static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt,
853 switch (odev->rx_parse_state) {
859 odev->rx_buf_missing) ? count : odev->
862 memcpy(((unsigned char *)(&odev->rx_ip_hdr)) +
863 odev->rx_buf_size, ip_pkt + buffer_offset,
866 odev->rx_buf_size += temp_bytes;
868 odev->rx_buf_missing -= temp_bytes;
871 if (!odev->rx_buf_missing) {
874 frame_len = ntohs(odev->rx_ip_hdr.tot_len);
878 dev_err(&odev->net->dev,
881 odev->rx_parse_state = WAIT_SYNC;
885 odev->skb_rx_buf = netdev_alloc_skb(odev->net,
887 if (!odev->skb_rx_buf) {
890 odev->rx_parse_state = WAIT_SYNC;
896 skb_put_data(odev->skb_rx_buf,
897 (char *)&(odev->rx_ip_hdr),
901 odev->rx_buf_size = sizeof(struct iphdr);
904 odev->rx_buf_missing =
906 odev->rx_parse_state = WAIT_DATA;
911 temp_bytes = (count < odev->rx_buf_missing)
912 ? count : odev->rx_buf_missing;
917 skb_put_data(odev->skb_rx_buf,
921 odev->rx_buf_missing -= temp_bytes;
924 odev->rx_buf_size += temp_bytes;
925 if (!odev->rx_buf_missing) {
928 odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP);
929 skb_reset_mac_header(odev->skb_rx_buf);
932 netif_rx(odev->skb_rx_buf);
934 odev->skb_rx_buf = NULL;
937 odev->net->stats.rx_packets++;
939 odev->net->stats.rx_bytes += odev->rx_buf_size;
941 odev->rx_buf_size = 0;
942 odev->rx_buf_missing = sizeof(struct iphdr);
943 odev->rx_parse_state = WAIT_IP;
960 if (odev->rx_parse_state == WAIT_SYNC) {
961 odev->rx_parse_state = WAIT_IP;
962 odev->rx_buf_size = 0;
963 odev->rx_buf_missing = sizeof(struct iphdr);
983 struct hso_net *odev = urb->context;
991 handle_usb_error(status, __func__, odev->parent);
996 if (!odev || !test_bit(HSO_NET_RUNNING, &odev->flags)) {
1002 net = odev->net;
1009 if (odev->parent->port_spec & HSO_INFO_CRC_BUG)
1010 fix_crc_bug(urb, odev->in_endp->wMaxPacketSize);
1016 spin_lock_irqsave(&odev->net_lock, flags);
1017 packetizeRx(odev, urb->transfer_buffer, urb->actual_length,
1020 spin_unlock_irqrestore(&odev->net_lock, flags);
1026 odev->parent->usb,
1027 usb_rcvbulkpipe(odev->parent->usb,
1028 odev->in_endp->
1031 read_bulk_callback, odev);
1037 dev_warn(&odev->parent->interface->dev,