Lines Matching refs:us

116 static inline int jumpshot_bulk_read(struct us_data *us,  in jumpshot_bulk_read()  argument
123 usb_stor_dbg(us, "len = %d\n", len); in jumpshot_bulk_read()
124 return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, in jumpshot_bulk_read()
129 static inline int jumpshot_bulk_write(struct us_data *us, in jumpshot_bulk_write() argument
136 usb_stor_dbg(us, "len = %d\n", len); in jumpshot_bulk_write()
137 return usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, in jumpshot_bulk_write()
142 static int jumpshot_get_status(struct us_data *us) in jumpshot_get_status() argument
146 if (!us) in jumpshot_get_status()
150 rc = usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, in jumpshot_get_status()
151 0, 0xA0, 0, 7, us->iobuf, 1); in jumpshot_get_status()
156 if (us->iobuf[0] != 0x50) { in jumpshot_get_status()
157 usb_stor_dbg(us, "0x%2x\n", us->iobuf[0]); in jumpshot_get_status()
164 static int jumpshot_read_data(struct us_data *us, in jumpshot_read_data() argument
169 unsigned char *command = us->iobuf; in jumpshot_read_data()
212 result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, in jumpshot_read_data()
218 result = jumpshot_bulk_read(us, buffer, len); in jumpshot_read_data()
222 usb_stor_dbg(us, "%d bytes\n", len); in jumpshot_read_data()
225 usb_stor_access_xfer_buf(buffer, len, us->srb, in jumpshot_read_data()
241 static int jumpshot_write_data(struct us_data *us, in jumpshot_write_data() argument
246 unsigned char *command = us->iobuf; in jumpshot_write_data()
281 usb_stor_access_xfer_buf(buffer, len, us->srb, in jumpshot_write_data()
294 result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, in jumpshot_write_data()
300 result = jumpshot_bulk_write(us, buffer, len); in jumpshot_write_data()
309 result = jumpshot_get_status(us); in jumpshot_write_data()
318 usb_stor_dbg(us, "Gah! Waitcount = 10. Bad write!?\n"); in jumpshot_write_data()
332 static int jumpshot_id_device(struct us_data *us, in jumpshot_id_device() argument
335 unsigned char *command = us->iobuf; in jumpshot_id_device()
349 rc = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, in jumpshot_id_device()
353 usb_stor_dbg(us, "Gah! send_control for read_capacity failed\n"); in jumpshot_id_device()
359 rc = jumpshot_bulk_read(us, reply, 512); in jumpshot_id_device()
377 static int jumpshot_handle_mode_sense(struct us_data *us, in jumpshot_handle_mode_sense() argument
395 struct jumpshot_info *info = (struct jumpshot_info *) (us->extra); in jumpshot_handle_mode_sense()
396 unsigned char *ptr = us->iobuf; in jumpshot_handle_mode_sense()
403 usb_stor_dbg(us, "Current values\n"); in jumpshot_handle_mode_sense()
406 usb_stor_dbg(us, "Changeable values\n"); in jumpshot_handle_mode_sense()
409 usb_stor_dbg(us, "Default values\n"); in jumpshot_handle_mode_sense()
412 usb_stor_dbg(us, "Saves values\n"); in jumpshot_handle_mode_sense()
485 static int jumpshot_transport(struct scsi_cmnd *srb, struct us_data *us) in jumpshot_transport() argument
490 unsigned char *ptr = us->iobuf; in jumpshot_transport()
495 if (!us->extra) { in jumpshot_transport()
496 us->extra = kzalloc(sizeof(struct jumpshot_info), GFP_NOIO); in jumpshot_transport()
497 if (!us->extra) in jumpshot_transport()
500 us->extra_destructor = jumpshot_info_destructor; in jumpshot_transport()
503 info = (struct jumpshot_info *) (us->extra); in jumpshot_transport()
506 usb_stor_dbg(us, "INQUIRY - Returning bogus response\n"); in jumpshot_transport()
508 fill_inquiry_response(us, ptr, 36); in jumpshot_transport()
515 rc = jumpshot_get_status(us); in jumpshot_transport()
519 rc = jumpshot_id_device(us, info); in jumpshot_transport()
523 usb_stor_dbg(us, "READ_CAPACITY: %ld sectors, %ld bytes per sector\n", in jumpshot_transport()
536 usb_stor_dbg(us, "Gah! MODE_SELECT_10\n"); in jumpshot_transport()
546 usb_stor_dbg(us, "READ_10: read block 0x%04lx count %ld\n", in jumpshot_transport()
548 return jumpshot_read_data(us, info, block, blocks); in jumpshot_transport()
560 usb_stor_dbg(us, "READ_12: read block 0x%04lx count %ld\n", in jumpshot_transport()
562 return jumpshot_read_data(us, info, block, blocks); in jumpshot_transport()
571 usb_stor_dbg(us, "WRITE_10: write block 0x%04lx count %ld\n", in jumpshot_transport()
573 return jumpshot_write_data(us, info, block, blocks); in jumpshot_transport()
585 usb_stor_dbg(us, "WRITE_12: write block 0x%04lx count %ld\n", in jumpshot_transport()
587 return jumpshot_write_data(us, info, block, blocks); in jumpshot_transport()
592 usb_stor_dbg(us, "TEST_UNIT_READY\n"); in jumpshot_transport()
593 return jumpshot_get_status(us); in jumpshot_transport()
597 usb_stor_dbg(us, "REQUEST_SENSE\n"); in jumpshot_transport()
611 usb_stor_dbg(us, "MODE_SENSE_6 detected\n"); in jumpshot_transport()
612 return jumpshot_handle_mode_sense(us, srb, 1); in jumpshot_transport()
616 usb_stor_dbg(us, "MODE_SENSE_10 detected\n"); in jumpshot_transport()
617 return jumpshot_handle_mode_sense(us, srb, 0); in jumpshot_transport()
630 usb_stor_dbg(us, "START_STOP\n"); in jumpshot_transport()
633 rc = jumpshot_id_device(us, info); in jumpshot_transport()
644 usb_stor_dbg(us, "Gah! Unknown command: %d (0x%x)\n", in jumpshot_transport()
657 struct us_data *us; in jumpshot_probe() local
660 result = usb_stor_probe1(&us, intf, id, in jumpshot_probe()
666 us->transport_name = "Lexar Jumpshot Control/Bulk"; in jumpshot_probe()
667 us->transport = jumpshot_transport; in jumpshot_probe()
668 us->transport_reset = usb_stor_Bulk_reset; in jumpshot_probe()
669 us->max_lun = 1; in jumpshot_probe()
671 result = usb_stor_probe2(us); in jumpshot_probe()