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