Lines Matching defs:odev
695 struct hso_net *odev = netdev_priv(net);
698 if (!odev) {
703 odev->skb_tx_buf = NULL;
706 spin_lock_irqsave(&odev->net_lock, flags);
707 odev->rx_parse_state = WAIT_IP;
708 odev->rx_buf_size = 0;
709 odev->rx_buf_missing = sizeof(struct iphdr);
710 spin_unlock_irqrestore(&odev->net_lock, flags);
713 set_bit(HSO_NET_RUNNING, &odev->flags);
714 hso_start_net_device(odev->parent);
725 struct hso_net *odev = netdev_priv(net);
730 clear_bit(HSO_NET_RUNNING, &odev->flags);
732 hso_stop_net_device(odev->parent);
741 struct hso_net *odev = urb->context;
745 if (!odev || !test_bit(HSO_NET_RUNNING, &odev->flags)) {
751 if (!netif_device_present(odev->net)) {
760 handle_usb_error(status, __func__, odev->parent);
762 hso_put_activity(odev->parent);
765 netif_wake_queue(odev->net);
772 struct hso_net *odev = netdev_priv(net);
777 if (hso_get_activity(odev->parent) == -EAGAIN) {
778 odev->skb_tx_buf = skb;
785 memcpy(odev->mux_bulk_tx_buf, skb->data, skb->len);
789 usb_fill_bulk_urb(odev->mux_bulk_tx_urb,
790 odev->parent->usb,
791 usb_sndbulkpipe(odev->parent->usb,
792 odev->out_endp->
794 odev->mux_bulk_tx_buf, skb->len, write_bulk_callback,
795 odev);
798 odev->mux_bulk_tx_urb->transfer_flags |= URB_ZERO_PACKET;
801 result = usb_submit_urb(odev->mux_bulk_tx_urb, GFP_ATOMIC);
803 dev_warn(&odev->parent->interface->dev,
823 struct hso_net *odev = netdev_priv(net);
825 if (!odev)
832 if (odev->mux_bulk_tx_urb)
833 usb_unlink_urb(odev->mux_bulk_tx_urb);
840 static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt,
852 switch (odev->rx_parse_state) {
858 odev->rx_buf_missing) ? count : odev->
861 memcpy(((unsigned char *)(&odev->rx_ip_hdr)) +
862 odev->rx_buf_size, ip_pkt + buffer_offset,
865 odev->rx_buf_size += temp_bytes;
867 odev->rx_buf_missing -= temp_bytes;
870 if (!odev->rx_buf_missing) {
873 frame_len = ntohs(odev->rx_ip_hdr.tot_len);
877 dev_err(&odev->net->dev,
880 odev->rx_parse_state = WAIT_SYNC;
884 odev->skb_rx_buf = netdev_alloc_skb(odev->net,
886 if (!odev->skb_rx_buf) {
889 odev->rx_parse_state = WAIT_SYNC;
895 skb_put_data(odev->skb_rx_buf,
896 (char *)&(odev->rx_ip_hdr),
900 odev->rx_buf_size = sizeof(struct iphdr);
903 odev->rx_buf_missing =
905 odev->rx_parse_state = WAIT_DATA;
910 temp_bytes = (count < odev->rx_buf_missing)
911 ? count : odev->rx_buf_missing;
916 skb_put_data(odev->skb_rx_buf,
920 odev->rx_buf_missing -= temp_bytes;
923 odev->rx_buf_size += temp_bytes;
924 if (!odev->rx_buf_missing) {
927 odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP);
928 skb_reset_mac_header(odev->skb_rx_buf);
931 netif_rx(odev->skb_rx_buf);
933 odev->skb_rx_buf = NULL;
936 odev->net->stats.rx_packets++;
938 odev->net->stats.rx_bytes += odev->rx_buf_size;
940 odev->rx_buf_size = 0;
941 odev->rx_buf_missing = sizeof(struct iphdr);
942 odev->rx_parse_state = WAIT_IP;
959 if (odev->rx_parse_state == WAIT_SYNC) {
960 odev->rx_parse_state = WAIT_IP;
961 odev->rx_buf_size = 0;
962 odev->rx_buf_missing = sizeof(struct iphdr);
982 struct hso_net *odev = urb->context;
990 handle_usb_error(status, __func__, odev->parent);
995 if (!odev || !test_bit(HSO_NET_RUNNING, &odev->flags)) {
1001 net = odev->net;
1008 if (odev->parent->port_spec & HSO_INFO_CRC_BUG)
1009 fix_crc_bug(urb, odev->in_endp->wMaxPacketSize);
1015 spin_lock_irqsave(&odev->net_lock, flags);
1016 packetizeRx(odev, urb->transfer_buffer, urb->actual_length,
1019 spin_unlock_irqrestore(&odev->net_lock, flags);
1025 odev->parent->usb,
1026 usb_rcvbulkpipe(odev->parent->usb,
1027 odev->in_endp->
1030 read_bulk_callback, odev);
1036 dev_warn(&odev->parent->interface->dev,