rndis.c (cc9b94029e9ef51787af908e9856b1eed314bc00) rndis.c (97f0117b4570cfd69db311d5d38b40665832a7a0)
1/*
2 * RNDIS MSG parser
3 *
4 * Authors: Benedikt Spranger, Pengutronix
5 * Robert Schwebel, Pengutronix
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

--- 66 unchanged lines hidden (view full) ---

75
76#ifdef CONFIG_USB_GADGET_DEBUG_FILES
77
78static const struct file_operations rndis_proc_fops;
79
80#endif /* CONFIG_USB_GADGET_DEBUG_FILES */
81
82/* supported OIDs */
1/*
2 * RNDIS MSG parser
3 *
4 * Authors: Benedikt Spranger, Pengutronix
5 * Robert Schwebel, Pengutronix
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

--- 66 unchanged lines hidden (view full) ---

75
76#ifdef CONFIG_USB_GADGET_DEBUG_FILES
77
78static const struct file_operations rndis_proc_fops;
79
80#endif /* CONFIG_USB_GADGET_DEBUG_FILES */
81
82/* supported OIDs */
83static const u32 oid_supported_list[] =
84{
83static const u32 oid_supported_list[] = {
85 /* the general stuff */
86 RNDIS_OID_GEN_SUPPORTED_LIST,
87 RNDIS_OID_GEN_HARDWARE_STATUS,
88 RNDIS_OID_GEN_MEDIA_SUPPORTED,
89 RNDIS_OID_GEN_MEDIA_IN_USE,
90 RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE,
91 RNDIS_OID_GEN_LINK_SPEED,
92 RNDIS_OID_GEN_TRANSMIT_BLOCK_SIZE,

--- 376 unchanged lines hidden (view full) ---

469 /* mandatory */
470 case RNDIS_OID_802_3_XMIT_MORE_COLLISIONS:
471 pr_debug("%s: RNDIS_OID_802_3_XMIT_MORE_COLLISIONS\n", __func__);
472 *outbuf = cpu_to_le32(0);
473 retval = 0;
474 break;
475
476 default:
84 /* the general stuff */
85 RNDIS_OID_GEN_SUPPORTED_LIST,
86 RNDIS_OID_GEN_HARDWARE_STATUS,
87 RNDIS_OID_GEN_MEDIA_SUPPORTED,
88 RNDIS_OID_GEN_MEDIA_IN_USE,
89 RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE,
90 RNDIS_OID_GEN_LINK_SPEED,
91 RNDIS_OID_GEN_TRANSMIT_BLOCK_SIZE,

--- 376 unchanged lines hidden (view full) ---

468 /* mandatory */
469 case RNDIS_OID_802_3_XMIT_MORE_COLLISIONS:
470 pr_debug("%s: RNDIS_OID_802_3_XMIT_MORE_COLLISIONS\n", __func__);
471 *outbuf = cpu_to_le32(0);
472 retval = 0;
473 break;
474
475 default:
477 pr_warning("%s: query unknown OID 0x%08X\n",
478 __func__, OID);
476 pr_warn("%s: query unknown OID 0x%08X\n", __func__, OID);
479 }
480 if (retval < 0)
481 length = 0;
482
483 resp->InformationBufferLength = cpu_to_le32(length);
484 r->length = length + sizeof(*resp);
485 resp->MessageLength = cpu_to_le32(r->length);
486 return retval;

--- 54 unchanged lines hidden (view full) ---

541
542 case RNDIS_OID_802_3_MULTICAST_LIST:
543 /* I think we can ignore this */
544 pr_debug("%s: RNDIS_OID_802_3_MULTICAST_LIST\n", __func__);
545 retval = 0;
546 break;
547
548 default:
477 }
478 if (retval < 0)
479 length = 0;
480
481 resp->InformationBufferLength = cpu_to_le32(length);
482 r->length = length + sizeof(*resp);
483 resp->MessageLength = cpu_to_le32(r->length);
484 return retval;

--- 54 unchanged lines hidden (view full) ---

539
540 case RNDIS_OID_802_3_MULTICAST_LIST:
541 /* I think we can ignore this */
542 pr_debug("%s: RNDIS_OID_802_3_MULTICAST_LIST\n", __func__);
543 retval = 0;
544 break;
545
546 default:
549 pr_warning("%s: set unknown OID 0x%08X, size %d\n",
550 __func__, OID, buf_len);
547 pr_warn("%s: set unknown OID 0x%08X, size %d\n",
548 __func__, OID, buf_len);
551 }
552
553 return retval;
554}
555
556/*
557 * Response Functions
558 */

--- 290 unchanged lines hidden (view full) ---

849 (rndis_keepalive_msg_type *)
850 buf);
851
852 default:
853 /* At least Windows XP emits some undefined RNDIS messages.
854 * In one case those messages seemed to relate to the host
855 * suspending itself.
856 */
549 }
550
551 return retval;
552}
553
554/*
555 * Response Functions
556 */

--- 290 unchanged lines hidden (view full) ---

847 (rndis_keepalive_msg_type *)
848 buf);
849
850 default:
851 /* At least Windows XP emits some undefined RNDIS messages.
852 * In one case those messages seemed to relate to the host
853 * suspending itself.
854 */
857 pr_warning("%s: unknown RNDIS message 0x%08X len %d\n",
855 pr_warn("%s: unknown RNDIS message 0x%08X len %d\n",
858 __func__, MsgType, MsgLength);
859 print_hex_dump_bytes(__func__, DUMP_PREFIX_OFFSET,
860 buf, MsgLength);
861 break;
862 }
863
864 return -ENOTSUPP;
865}

--- 315 unchanged lines hidden ---
856 __func__, MsgType, MsgLength);
857 print_hex_dump_bytes(__func__, DUMP_PREFIX_OFFSET,
858 buf, MsgLength);
859 break;
860 }
861
862 return -ENOTSUPP;
863}

--- 315 unchanged lines hidden ---