Lines Matching refs:us

114 static inline int jumpshot_bulk_read(struct us_data *us,  in jumpshot_bulk_read()  argument
121 usb_stor_dbg(us, "len = %d\n", len); in jumpshot_bulk_read()
122 return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, in jumpshot_bulk_read()
127 static inline int jumpshot_bulk_write(struct us_data *us, in jumpshot_bulk_write() argument
134 usb_stor_dbg(us, "len = %d\n", len); in jumpshot_bulk_write()
135 return usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, in jumpshot_bulk_write()
140 static int jumpshot_get_status(struct us_data *us) in jumpshot_get_status() argument
144 if (!us) in jumpshot_get_status()
148 rc = usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, in jumpshot_get_status()
149 0, 0xA0, 0, 7, us->iobuf, 1); in jumpshot_get_status()
154 if (us->iobuf[0] != 0x50) { in jumpshot_get_status()
155 usb_stor_dbg(us, "0x%2x\n", us->iobuf[0]); in jumpshot_get_status()
162 static int jumpshot_read_data(struct us_data *us, in jumpshot_read_data() argument
167 unsigned char *command = us->iobuf; in jumpshot_read_data()
210 result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, in jumpshot_read_data()
216 result = jumpshot_bulk_read(us, buffer, len); in jumpshot_read_data()
220 usb_stor_dbg(us, "%d bytes\n", len); in jumpshot_read_data()
223 usb_stor_access_xfer_buf(buffer, len, us->srb, in jumpshot_read_data()
239 static int jumpshot_write_data(struct us_data *us, in jumpshot_write_data() argument
244 unsigned char *command = us->iobuf; in jumpshot_write_data()
279 usb_stor_access_xfer_buf(buffer, len, us->srb, in jumpshot_write_data()
292 result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, in jumpshot_write_data()
298 result = jumpshot_bulk_write(us, buffer, len); in jumpshot_write_data()
307 result = jumpshot_get_status(us); in jumpshot_write_data()
316 usb_stor_dbg(us, "Gah! Waitcount = 10. Bad write!?\n"); in jumpshot_write_data()
330 static int jumpshot_id_device(struct us_data *us, in jumpshot_id_device() argument
333 unsigned char *command = us->iobuf; in jumpshot_id_device()
347 rc = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, in jumpshot_id_device()
351 usb_stor_dbg(us, "Gah! send_control for read_capacity failed\n"); in jumpshot_id_device()
357 rc = jumpshot_bulk_read(us, reply, 512); in jumpshot_id_device()
375 static int jumpshot_handle_mode_sense(struct us_data *us, in jumpshot_handle_mode_sense() argument
393 struct jumpshot_info *info = (struct jumpshot_info *) (us->extra); in jumpshot_handle_mode_sense()
394 unsigned char *ptr = us->iobuf; in jumpshot_handle_mode_sense()
401 usb_stor_dbg(us, "Current values\n"); in jumpshot_handle_mode_sense()
404 usb_stor_dbg(us, "Changeable values\n"); in jumpshot_handle_mode_sense()
407 usb_stor_dbg(us, "Default values\n"); in jumpshot_handle_mode_sense()
410 usb_stor_dbg(us, "Saves values\n"); in jumpshot_handle_mode_sense()
483 static int jumpshot_transport(struct scsi_cmnd *srb, struct us_data *us) in jumpshot_transport() argument
488 unsigned char *ptr = us->iobuf; in jumpshot_transport()
493 if (!us->extra) { in jumpshot_transport()
494 us->extra = kzalloc(sizeof(struct jumpshot_info), GFP_NOIO); in jumpshot_transport()
495 if (!us->extra) in jumpshot_transport()
498 us->extra_destructor = jumpshot_info_destructor; in jumpshot_transport()
501 info = (struct jumpshot_info *) (us->extra); in jumpshot_transport()
504 usb_stor_dbg(us, "INQUIRY - Returning bogus response\n"); in jumpshot_transport()
506 fill_inquiry_response(us, ptr, 36); in jumpshot_transport()
513 rc = jumpshot_get_status(us); in jumpshot_transport()
517 rc = jumpshot_id_device(us, info); in jumpshot_transport()
521 usb_stor_dbg(us, "READ_CAPACITY: %ld sectors, %ld bytes per sector\n", in jumpshot_transport()
534 usb_stor_dbg(us, "Gah! MODE_SELECT_10\n"); in jumpshot_transport()
544 usb_stor_dbg(us, "READ_10: read block 0x%04lx count %ld\n", in jumpshot_transport()
546 return jumpshot_read_data(us, info, block, blocks); in jumpshot_transport()
558 usb_stor_dbg(us, "READ_12: read block 0x%04lx count %ld\n", in jumpshot_transport()
560 return jumpshot_read_data(us, info, block, blocks); in jumpshot_transport()
569 usb_stor_dbg(us, "WRITE_10: write block 0x%04lx count %ld\n", in jumpshot_transport()
571 return jumpshot_write_data(us, info, block, blocks); in jumpshot_transport()
583 usb_stor_dbg(us, "WRITE_12: write block 0x%04lx count %ld\n", in jumpshot_transport()
585 return jumpshot_write_data(us, info, block, blocks); in jumpshot_transport()
590 usb_stor_dbg(us, "TEST_UNIT_READY\n"); in jumpshot_transport()
591 return jumpshot_get_status(us); in jumpshot_transport()
595 usb_stor_dbg(us, "REQUEST_SENSE\n"); in jumpshot_transport()
609 usb_stor_dbg(us, "MODE_SENSE_6 detected\n"); in jumpshot_transport()
610 return jumpshot_handle_mode_sense(us, srb, 1); in jumpshot_transport()
614 usb_stor_dbg(us, "MODE_SENSE_10 detected\n"); in jumpshot_transport()
615 return jumpshot_handle_mode_sense(us, srb, 0); in jumpshot_transport()
628 usb_stor_dbg(us, "START_STOP\n"); in jumpshot_transport()
631 rc = jumpshot_id_device(us, info); in jumpshot_transport()
642 usb_stor_dbg(us, "Gah! Unknown command: %d (0x%x)\n", in jumpshot_transport()
653 struct us_data *us; in jumpshot_probe() local
656 result = usb_stor_probe1(&us, intf, id, in jumpshot_probe()
661 us->transport_name = "Lexar Jumpshot Control/Bulk"; in jumpshot_probe()
662 us->transport = jumpshot_transport; in jumpshot_probe()
663 us->transport_reset = usb_stor_Bulk_reset; in jumpshot_probe()
664 us->max_lun = 1; in jumpshot_probe()
666 result = usb_stor_probe2(us); in jumpshot_probe()