Lines Matching full:us

110 sddr55_bulk_transport(struct us_data *us, int direction,  in sddr55_bulk_transport()  argument
112 struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra; in sddr55_bulk_transport()
114 us->recv_bulk_pipe : us->send_bulk_pipe; in sddr55_bulk_transport()
119 return usb_stor_bulk_transfer_buf(us, pipe, data, len, NULL); in sddr55_bulk_transport()
127 static int sddr55_status(struct us_data *us) in sddr55_status() argument
130 unsigned char *command = us->iobuf; in sddr55_status()
131 unsigned char *status = us->iobuf; in sddr55_status()
132 struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra; in sddr55_status()
138 result = sddr55_bulk_transport(us, in sddr55_status()
141 usb_stor_dbg(us, "Result for send_command in status %d\n", result); in sddr55_status()
148 result = sddr55_bulk_transport(us, in sddr55_status()
175 result = sddr55_bulk_transport(us, in sddr55_status()
187 static int sddr55_read_data(struct us_data *us, in sddr55_read_data() argument
193 unsigned char *command = us->iobuf; in sddr55_read_data()
194 unsigned char *status = us->iobuf; in sddr55_read_data()
195 struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra; in sddr55_read_data()
231 usb_stor_dbg(us, "Read %02X pages, from PBA %04X (LBA %04X) page %02X\n", in sddr55_read_data()
252 result = sddr55_bulk_transport(us, in sddr55_read_data()
255 usb_stor_dbg(us, "Result for send_command in read_data %d\n", in sddr55_read_data()
264 result = sddr55_bulk_transport(us, in sddr55_read_data()
273 result = sddr55_bulk_transport(us, in sddr55_read_data()
290 usb_stor_access_xfer_buf(buffer, len, us->srb, in sddr55_read_data()
306 static int sddr55_write_data(struct us_data *us, in sddr55_write_data() argument
312 unsigned char *command = us->iobuf; in sddr55_write_data()
313 unsigned char *status = us->iobuf; in sddr55_write_data()
314 struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra; in sddr55_write_data()
359 usb_stor_access_xfer_buf(buffer, len, us->srb, in sddr55_write_data()
362 usb_stor_dbg(us, "Write %02X pages, to PBA %04X (LBA %04X) page %02X\n", in sddr55_write_data()
377 usb_stor_dbg(us, "No PBA for LBA %04X\n", lba); in sddr55_write_data()
400 usb_stor_dbg(us, "Couldn't find unallocated block\n"); in sddr55_write_data()
407 usb_stor_dbg(us, "Allocating PBA %04X for LBA %04X\n", in sddr55_write_data()
429 result = sddr55_bulk_transport(us, in sddr55_write_data()
433 usb_stor_dbg(us, "Result for send_command in write_data %d\n", in sddr55_write_data()
443 result = sddr55_bulk_transport(us, in sddr55_write_data()
447 usb_stor_dbg(us, "Result for send_data in write_data %d\n", in sddr55_write_data()
457 result = sddr55_bulk_transport(us, DMA_FROM_DEVICE, status, 6); in sddr55_write_data()
460 usb_stor_dbg(us, "Result for get_status in write_data %d\n", in sddr55_write_data()
481 usb_stor_dbg(us, "Updating maps for LBA %04X: old PBA %04X, new PBA %04X\n", in sddr55_write_data()
512 static int sddr55_read_deviceID(struct us_data *us, in sddr55_read_deviceID() argument
517 unsigned char *command = us->iobuf; in sddr55_read_deviceID()
518 unsigned char *content = us->iobuf; in sddr55_read_deviceID()
523 result = sddr55_bulk_transport(us, DMA_TO_DEVICE, command, 8); in sddr55_read_deviceID()
525 usb_stor_dbg(us, "Result of send_control for device ID is %d\n", in sddr55_read_deviceID()
531 result = sddr55_bulk_transport(us, in sddr55_read_deviceID()
541 result = sddr55_bulk_transport(us, in sddr55_read_deviceID()
549 static int sddr55_reset(struct us_data *us) in sddr55_reset() argument
555 static unsigned long sddr55_get_capacity(struct us_data *us) { in sddr55_get_capacity() argument
560 struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra; in sddr55_get_capacity()
562 usb_stor_dbg(us, "Reading capacity...\n"); in sddr55_get_capacity()
564 result = sddr55_read_deviceID(us, in sddr55_get_capacity()
568 usb_stor_dbg(us, "Result of read_deviceID is %d\n", result); in sddr55_get_capacity()
573 usb_stor_dbg(us, "Device ID = %02X\n", deviceID); in sddr55_get_capacity()
574 usb_stor_dbg(us, "Manuf ID = %02X\n", manufacturerID); in sddr55_get_capacity()
639 static int sddr55_read_map(struct us_data *us) { in sddr55_read_map() argument
641 struct sddr55_card_info *info = (struct sddr55_card_info *)(us->extra); in sddr55_read_map()
644 unsigned char *command = us->iobuf; in sddr55_read_map()
665 result = sddr55_bulk_transport(us, DMA_TO_DEVICE, command, 8); in sddr55_read_map()
672 result = sddr55_bulk_transport(us, DMA_FROM_DEVICE, buffer, numblocks * 2); in sddr55_read_map()
679 result = sddr55_bulk_transport(us, DMA_FROM_DEVICE, command, 2); in sddr55_read_map()
751 usb_stor_dbg(us, "LBA %04X <-> PBA %04X\n", lba, i); in sddr55_read_map()
775 static int sddr55_transport(struct scsi_cmnd *srb, struct us_data *us) in sddr55_transport() argument
787 unsigned char *ptr = us->iobuf; in sddr55_transport()
795 if (!us->extra) { in sddr55_transport()
796 us->extra = kzalloc( in sddr55_transport()
798 if (!us->extra) in sddr55_transport()
800 us->extra_destructor = sddr55_card_info_destructor; in sddr55_transport()
803 info = (struct sddr55_card_info *)(us->extra); in sddr55_transport()
806 usb_stor_dbg(us, "request sense %02x/%02x/%02x\n", in sddr55_transport()
829 fill_inquiry_response(us, ptr, 36); in sddr55_transport()
840 result = sddr55_status (us); in sddr55_transport()
842 result = sddr55_status (us); in sddr55_transport()
862 capacity = sddr55_get_capacity(us); in sddr55_transport()
890 sddr55_read_map(us); in sddr55_transport()
902 usb_stor_dbg(us, "Dummy up request for mode page 1\n"); in sddr55_transport()
906 usb_stor_dbg(us, "Dummy up request for all mode pages\n"); in sddr55_transport()
916 usb_stor_dbg(us, "%s medium removal. Not that I can do anything about it...\n", in sddr55_transport()
941 usb_stor_dbg(us, "Error: Requested LBA %04X exceeds maximum block %04X\n", in sddr55_transport()
952 usb_stor_dbg(us, "WRITE_10: write block %04X (LBA %04X) page %01X pages %d\n", in sddr55_transport()
955 return sddr55_write_data(us, lba, page, pages); in sddr55_transport()
957 usb_stor_dbg(us, "READ_10: read block %04X (LBA %04X) page %01X pages %d\n", in sddr55_transport()
960 return sddr55_read_data(us, lba, page, pages); in sddr55_transport()
983 struct us_data *us; in sddr55_probe() local
986 result = usb_stor_probe1(&us, intf, id, in sddr55_probe()
992 us->transport_name = "SDDR55"; in sddr55_probe()
993 us->transport = sddr55_transport; in sddr55_probe()
994 us->transport_reset = sddr55_reset; in sddr55_probe()
995 us->max_lun = 0; in sddr55_probe()
997 result = usb_stor_probe2(us); in sddr55_probe()