Lines Matching full:us
105 static inline int jumpshot_bulk_read(struct us_data *us, in jumpshot_bulk_read() argument
112 usb_stor_dbg(us, "len = %d\n", len); in jumpshot_bulk_read()
113 return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, in jumpshot_bulk_read()
118 static inline int jumpshot_bulk_write(struct us_data *us, in jumpshot_bulk_write() argument
125 usb_stor_dbg(us, "len = %d\n", len); in jumpshot_bulk_write()
126 return usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, in jumpshot_bulk_write()
131 static int jumpshot_get_status(struct us_data *us) in jumpshot_get_status() argument
135 if (!us) in jumpshot_get_status()
139 rc = usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, in jumpshot_get_status()
140 0, 0xA0, 0, 7, us->iobuf, 1); in jumpshot_get_status()
145 if (us->iobuf[0] != 0x50) { in jumpshot_get_status()
146 usb_stor_dbg(us, "0x%2x\n", us->iobuf[0]); in jumpshot_get_status()
153 static int jumpshot_read_data(struct us_data *us, in jumpshot_read_data() argument
158 unsigned char *command = us->iobuf; in jumpshot_read_data()
201 result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, in jumpshot_read_data()
207 result = jumpshot_bulk_read(us, buffer, len); in jumpshot_read_data()
211 usb_stor_dbg(us, "%d bytes\n", len); in jumpshot_read_data()
214 usb_stor_access_xfer_buf(buffer, len, us->srb, in jumpshot_read_data()
230 static int jumpshot_write_data(struct us_data *us, in jumpshot_write_data() argument
235 unsigned char *command = us->iobuf; in jumpshot_write_data()
270 usb_stor_access_xfer_buf(buffer, len, us->srb, in jumpshot_write_data()
283 result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, in jumpshot_write_data()
289 result = jumpshot_bulk_write(us, buffer, len); in jumpshot_write_data()
298 result = jumpshot_get_status(us); in jumpshot_write_data()
307 usb_stor_dbg(us, "Gah! Waitcount = 10. Bad write!?\n"); in jumpshot_write_data()
321 static int jumpshot_id_device(struct us_data *us, in jumpshot_id_device() argument
324 unsigned char *command = us->iobuf; in jumpshot_id_device()
338 rc = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, in jumpshot_id_device()
342 usb_stor_dbg(us, "Gah! send_control for read_capacity failed\n"); in jumpshot_id_device()
348 rc = jumpshot_bulk_read(us, reply, 512); in jumpshot_id_device()
366 static int jumpshot_handle_mode_sense(struct us_data *us, in jumpshot_handle_mode_sense() argument
384 struct jumpshot_info *info = (struct jumpshot_info *) (us->extra); in jumpshot_handle_mode_sense()
385 unsigned char *ptr = us->iobuf; in jumpshot_handle_mode_sense()
392 usb_stor_dbg(us, "Current values\n"); in jumpshot_handle_mode_sense()
395 usb_stor_dbg(us, "Changeable values\n"); in jumpshot_handle_mode_sense()
398 usb_stor_dbg(us, "Default values\n"); in jumpshot_handle_mode_sense()
401 usb_stor_dbg(us, "Saves values\n"); in jumpshot_handle_mode_sense()
474 static int jumpshot_transport(struct scsi_cmnd *srb, struct us_data *us) in jumpshot_transport() argument
479 unsigned char *ptr = us->iobuf; in jumpshot_transport()
484 if (!us->extra) { in jumpshot_transport()
485 us->extra = kzalloc(sizeof(struct jumpshot_info), GFP_NOIO); in jumpshot_transport()
486 if (!us->extra) in jumpshot_transport()
489 us->extra_destructor = jumpshot_info_destructor; in jumpshot_transport()
492 info = (struct jumpshot_info *) (us->extra); in jumpshot_transport()
495 usb_stor_dbg(us, "INQUIRY - Returning bogus response\n"); in jumpshot_transport()
497 fill_inquiry_response(us, ptr, 36); in jumpshot_transport()
504 rc = jumpshot_get_status(us); in jumpshot_transport()
508 rc = jumpshot_id_device(us, info); in jumpshot_transport()
512 usb_stor_dbg(us, "READ_CAPACITY: %ld sectors, %ld bytes per sector\n", in jumpshot_transport()
525 usb_stor_dbg(us, "Gah! MODE_SELECT_10\n"); in jumpshot_transport()
535 usb_stor_dbg(us, "READ_10: read block 0x%04lx count %ld\n", in jumpshot_transport()
537 return jumpshot_read_data(us, info, block, blocks); in jumpshot_transport()
549 usb_stor_dbg(us, "READ_12: read block 0x%04lx count %ld\n", in jumpshot_transport()
551 return jumpshot_read_data(us, info, block, blocks); in jumpshot_transport()
560 usb_stor_dbg(us, "WRITE_10: write block 0x%04lx count %ld\n", in jumpshot_transport()
562 return jumpshot_write_data(us, info, block, blocks); in jumpshot_transport()
574 usb_stor_dbg(us, "WRITE_12: write block 0x%04lx count %ld\n", in jumpshot_transport()
576 return jumpshot_write_data(us, info, block, blocks); in jumpshot_transport()
581 usb_stor_dbg(us, "TEST_UNIT_READY\n"); in jumpshot_transport()
582 return jumpshot_get_status(us); in jumpshot_transport()
586 usb_stor_dbg(us, "REQUEST_SENSE\n"); in jumpshot_transport()
600 usb_stor_dbg(us, "MODE_SENSE_6 detected\n"); in jumpshot_transport()
601 return jumpshot_handle_mode_sense(us, srb, 1); in jumpshot_transport()
605 usb_stor_dbg(us, "MODE_SENSE_10 detected\n"); in jumpshot_transport()
606 return jumpshot_handle_mode_sense(us, srb, 0); in jumpshot_transport()
622 usb_stor_dbg(us, "START_STOP\n"); in jumpshot_transport()
627 rc = jumpshot_id_device(us, info); in jumpshot_transport()
638 usb_stor_dbg(us, "Gah! Unknown command: %d (0x%x)\n", in jumpshot_transport()
651 struct us_data *us; in jumpshot_probe() local
654 result = usb_stor_probe1(&us, intf, id, in jumpshot_probe()
660 us->transport_name = "Lexar Jumpshot Control/Bulk"; in jumpshot_probe()
661 us->transport = jumpshot_transport; in jumpshot_probe()
662 us->transport_reset = usb_stor_Bulk_reset; in jumpshot_probe()
663 us->max_lun = 1; in jumpshot_probe()
665 result = usb_stor_probe2(us); in jumpshot_probe()