Listing 2. How a structure is read from the USB connection and

converted into the proper CPU format.

struct visor_connection_info *connection_info;

/* send a get connection info request */
usb_control_msg (serial->dev,
                 usb_rcvctrlpipe(serial->dev, 0),
                 VISOR_GET_CONNECTION_INFORMATION,
                 0xc2, 0x0000, 0x0000,
                 transfer_buffer, 0x12, 300);

connection_info = (struct visor_connection_info *)
    transfer_buffer;

le16_to_cpus(&connection_info->num_ports);