Lines Matching +full:0 +full:us

44 #define ALAUDA_STATUS_ERROR		0x01
45 #define ALAUDA_STATUS_READY 0x40
50 #define ALAUDA_GET_XD_MEDIA_STATUS 0x08
51 #define ALAUDA_GET_SM_MEDIA_STATUS 0x98
52 #define ALAUDA_ACK_XD_MEDIA_CHANGE 0x0a
53 #define ALAUDA_ACK_SM_MEDIA_CHANGE 0x9a
54 #define ALAUDA_GET_XD_MEDIA_SIG 0x86
55 #define ALAUDA_GET_SM_MEDIA_SIG 0x96
58 * Bulk command identity (byte 0)
60 #define ALAUDA_BULK_CMD 0x40
65 #define ALAUDA_BULK_GET_REDU_DATA 0x85
66 #define ALAUDA_BULK_READ_BLOCK 0x94
67 #define ALAUDA_BULK_ERASE_BLOCK 0xa3
68 #define ALAUDA_BULK_WRITE_BLOCK 0xb4
69 #define ALAUDA_BULK_GET_STATUS2 0xb7
70 #define ALAUDA_BULK_RESET_MEDIA 0xe0
75 #define ALAUDA_PORT_XD 0x00
76 #define ALAUDA_PORT_SM 0x01
81 #define UNDEF 0xffff
82 #define SPARE 0xfffe
83 #define UNUSABLE 0xfffd
113 #define LSB_of(s) ((s)&0xFF)
116 #define MEDIA_PORT(us) us->srb->device->lun argument
117 #define MEDIA_INFO(us) ((struct alauda_info *)us->extra)->port[MEDIA_PORT(us)] argument
119 #define PBA_LO(pba) ((pba & 0xF) << 5)
123 static int init_alauda(struct us_data *us);
179 { 0x6e, 20, 8, 4, 8}, /* 1 MB */
180 { 0xe8, 20, 8, 4, 8}, /* 1 MB */
181 { 0xec, 20, 8, 4, 8}, /* 1 MB */
182 { 0x64, 21, 8, 4, 9}, /* 2 MB */
183 { 0xea, 21, 8, 4, 9}, /* 2 MB */
184 { 0x6b, 22, 9, 4, 9}, /* 4 MB */
185 { 0xe3, 22, 9, 4, 9}, /* 4 MB */
186 { 0xe5, 22, 9, 4, 9}, /* 4 MB */
187 { 0xe6, 23, 9, 4, 10}, /* 8 MB */
188 { 0x73, 24, 9, 5, 10}, /* 16 MB */
189 { 0x75, 25, 9, 5, 10}, /* 32 MB */
190 { 0x76, 26, 9, 5, 10}, /* 64 MB */
191 { 0x79, 27, 9, 5, 10}, /* 128 MB */
192 { 0x71, 28, 9, 5, 10}, /* 256 MB */
195 { 0x5d, 21, 9, 4, 8}, /* 2 MB */
196 { 0xd5, 22, 9, 4, 9}, /* 4 MB */
197 { 0xd6, 23, 9, 4, 10}, /* 8 MB */
198 { 0x57, 24, 9, 4, 11}, /* 16 MB */
199 { 0x58, 25, 9, 4, 12}, /* 32 MB */
200 { 0,}
207 for (i = 0; alauda_card_ids[i].id != 0; i++) in alauda_card_find_id()
224 parity[0] = 0; in nand_init_ecc()
228 for (i = 0; i < 256; i++) { in nand_init_ecc()
229 a = 0; in nand_init_ecc()
230 for (j = 0; j < 8; j++) { in nand_init_ecc()
232 if ((j & 1) == 0) in nand_init_ecc()
233 a ^= 0x04; in nand_init_ecc()
234 if ((j & 2) == 0) in nand_init_ecc()
235 a ^= 0x10; in nand_init_ecc()
236 if ((j & 4) == 0) in nand_init_ecc()
237 a ^= 0x40; in nand_init_ecc()
240 ecc2[i] = ~(a ^ (a<<1) ^ (parity[i] ? 0xa8 : 0)); in nand_init_ecc()
248 unsigned char par = 0, bit, bits[8] = {0}; in nand_compute_ecc()
251 for (i = 0; i < 256; i++) { in nand_compute_ecc()
254 for (j = 0; j < 8; j++) in nand_compute_ecc()
255 if ((i & (1<<j)) == 0) in nand_compute_ecc()
260 a = (bits[3] << 6) + (bits[2] << 4) + (bits[1] << 2) + bits[0]; in nand_compute_ecc()
261 ecc[0] = ~(a ^ (a<<1) ^ (parity[par] ? 0xaa : 0)); in nand_compute_ecc()
264 ecc[1] = ~(a ^ (a<<1) ^ (parity[par] ? 0xaa : 0)); in nand_compute_ecc()
271 return (data[0] == ecc[0] && data[1] == ecc[1] && data[2] == ecc[2]); in nand_compare_ecc()
294 for (i = 0; i < num_zones; i++) { in alauda_free_maps()
300 for (i = 0; i < num_zones; i++) { in alauda_free_maps()
310 static int alauda_get_media_status(struct us_data *us, unsigned char *data) in alauda_get_media_status() argument
315 if (MEDIA_PORT(us) == ALAUDA_PORT_XD) in alauda_get_media_status()
320 rc = usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, in alauda_get_media_status()
321 command, 0xc0, 0, 1, data, 2); in alauda_get_media_status()
324 usb_stor_dbg(us, "Media status %02X %02X\n", data[0], data[1]); in alauda_get_media_status()
333 static int alauda_ack_media(struct us_data *us) in alauda_ack_media() argument
337 if (MEDIA_PORT(us) == ALAUDA_PORT_XD) in alauda_ack_media()
342 return usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, in alauda_ack_media()
343 command, 0x40, 0, 1, NULL, 0); in alauda_ack_media()
350 static int alauda_get_media_signature(struct us_data *us, unsigned char *data) in alauda_get_media_signature() argument
354 if (MEDIA_PORT(us) == ALAUDA_PORT_XD) in alauda_get_media_signature()
359 return usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, in alauda_get_media_signature()
360 command, 0xc0, 0, 0, data, 4); in alauda_get_media_signature()
366 static int alauda_reset_media(struct us_data *us) in alauda_reset_media() argument
368 unsigned char *command = us->iobuf; in alauda_reset_media()
370 memset(command, 0, 9); in alauda_reset_media()
371 command[0] = ALAUDA_BULK_CMD; in alauda_reset_media()
373 command[8] = MEDIA_PORT(us); in alauda_reset_media()
375 return usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, in alauda_reset_media()
382 static int alauda_init_media(struct us_data *us) in alauda_init_media() argument
384 unsigned char *data = us->iobuf; in alauda_init_media()
385 int ready = 0; in alauda_init_media()
389 while (ready == 0) { in alauda_init_media()
392 if (alauda_get_media_status(us, data) != USB_STOR_XFER_GOOD) in alauda_init_media()
395 if (data[0] & 0x10) in alauda_init_media()
399 usb_stor_dbg(us, "We are ready for action!\n"); in alauda_init_media()
401 if (alauda_ack_media(us) != USB_STOR_XFER_GOOD) in alauda_init_media()
406 if (alauda_get_media_status(us, data) != USB_STOR_XFER_GOOD) in alauda_init_media()
409 if (data[0] != 0x14) { in alauda_init_media()
410 usb_stor_dbg(us, "Media not ready after ack\n"); in alauda_init_media()
414 if (alauda_get_media_signature(us, data) != USB_STOR_XFER_GOOD) in alauda_init_media()
417 usb_stor_dbg(us, "Media signature: %4ph\n", data); in alauda_init_media()
425 MEDIA_INFO(us).capacity = 1 << media_info->chipshift; in alauda_init_media()
426 usb_stor_dbg(us, "Found media with capacity: %ldMB\n", in alauda_init_media()
427 MEDIA_INFO(us).capacity >> 20); in alauda_init_media()
429 MEDIA_INFO(us).pageshift = media_info->pageshift; in alauda_init_media()
430 MEDIA_INFO(us).blockshift = media_info->blockshift; in alauda_init_media()
431 MEDIA_INFO(us).zoneshift = media_info->zoneshift; in alauda_init_media()
433 MEDIA_INFO(us).pagesize = 1 << media_info->pageshift; in alauda_init_media()
434 MEDIA_INFO(us).blocksize = 1 << media_info->blockshift; in alauda_init_media()
435 MEDIA_INFO(us).zonesize = 1 << media_info->zoneshift; in alauda_init_media()
437 MEDIA_INFO(us).uzonesize = ((1 << media_info->zoneshift) / 128) * 125; in alauda_init_media()
438 MEDIA_INFO(us).blockmask = MEDIA_INFO(us).blocksize - 1; in alauda_init_media()
440 num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift in alauda_init_media()
441 + MEDIA_INFO(us).blockshift + MEDIA_INFO(us).pageshift); in alauda_init_media()
442 MEDIA_INFO(us).pba_to_lba = kcalloc(num_zones, sizeof(u16*), GFP_NOIO); in alauda_init_media()
443 MEDIA_INFO(us).lba_to_pba = kcalloc(num_zones, sizeof(u16*), GFP_NOIO); in alauda_init_media()
444 if (MEDIA_INFO(us).pba_to_lba == NULL || MEDIA_INFO(us).lba_to_pba == NULL) in alauda_init_media()
447 if (alauda_reset_media(us) != USB_STOR_XFER_GOOD) in alauda_init_media()
457 static int alauda_check_media(struct us_data *us) in alauda_check_media() argument
459 struct alauda_info *info = (struct alauda_info *) us->extra; in alauda_check_media()
460 unsigned char *status = us->iobuf; in alauda_check_media()
463 rc = alauda_get_media_status(us, status); in alauda_check_media()
465 status[0] = 0xF0; /* Pretend there's no media */ in alauda_check_media()
466 status[1] = 0; in alauda_check_media()
470 if ((status[0] & 0x80) || ((status[0] & 0x1F) == 0x10) in alauda_check_media()
471 || ((status[1] & 0x01) == 0)) { in alauda_check_media()
472 usb_stor_dbg(us, "No media, or door open\n"); in alauda_check_media()
473 alauda_free_maps(&MEDIA_INFO(us)); in alauda_check_media()
474 info->sense_key = 0x02; in alauda_check_media()
475 info->sense_asc = 0x3A; in alauda_check_media()
476 info->sense_ascq = 0x00; in alauda_check_media()
481 if (status[0] & 0x08 || !info->media_initialized) { in alauda_check_media()
482 usb_stor_dbg(us, "Media change detected\n"); in alauda_check_media()
483 alauda_free_maps(&MEDIA_INFO(us)); in alauda_check_media()
484 rc = alauda_init_media(us); in alauda_check_media()
488 info->sense_asc = 0x28; in alauda_check_media()
489 info->sense_ascq = 0x00; in alauda_check_media()
500 static int alauda_check_status2(struct us_data *us) in alauda_check_status2() argument
505 0, 0, 0, 0, 3, 0, MEDIA_PORT(us) in alauda_check_status2()
509 rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, in alauda_check_status2()
514 rc = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, in alauda_check_status2()
519 usb_stor_dbg(us, "%3ph\n", data); in alauda_check_status2()
520 if (data[0] & ALAUDA_STATUS_ERROR) in alauda_check_status2()
530 static int alauda_get_redu_data(struct us_data *us, u16 pba, unsigned char *data) in alauda_get_redu_data() argument
535 PBA_HI(pba), PBA_ZONE(pba), 0, PBA_LO(pba), 0, 0, MEDIA_PORT(us) in alauda_get_redu_data()
538 rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, in alauda_get_redu_data()
543 return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, in alauda_get_redu_data()
549 * Returns the absolute PBA of an unused PBA, or 0 if none found.
557 for (i = 0; i < info->zonesize; i++) in alauda_find_unused_pba()
561 return 0; in alauda_find_unused_pba()
568 static int alauda_read_map(struct us_data *us, unsigned int zone) in alauda_read_map() argument
570 unsigned char *data = us->iobuf; in alauda_read_map()
573 unsigned int zonesize = MEDIA_INFO(us).zonesize; in alauda_read_map()
574 unsigned int uzonesize = MEDIA_INFO(us).uzonesize; in alauda_read_map()
585 usb_stor_dbg(us, "Mapping blocks for zone %d\n", zone); in alauda_read_map()
588 for (i = 0; i < zonesize; i++) in alauda_read_map()
591 for (i = 0; i < zonesize; i++) { in alauda_read_map()
594 result = alauda_get_redu_data(us, blocknum, data); in alauda_read_map()
600 /* special PBAs have control field 0^16 */ in alauda_read_map()
601 for (j = 0; j < 16; j++) in alauda_read_map()
602 if (data[j] != 0) in alauda_read_map()
605 usb_stor_dbg(us, "PBA %d has no logical mapping\n", blocknum); in alauda_read_map()
610 for (j = 0; j < 16; j++) in alauda_read_map()
611 if (data[j] != 0xff) in alauda_read_map()
618 …usb_stor_dbg(us, "PBA %d has no logical mapping: reserved area = %02X%02X%02X%02X data status %02X… in alauda_read_map()
620 data[0], data[1], data[2], data[3], in alauda_read_map()
626 if ((data[6] >> 4) != 0x01) { in alauda_read_map()
627 usb_stor_dbg(us, "PBA %d has invalid address field %02X%02X/%02X%02X\n", in alauda_read_map()
644 lba_offset = (lba_offset & 0x07FF) >> 1; in alauda_read_map()
651 * In other words, in PBA 1024-2047 you will find LBA 0-999 in alauda_read_map()
676 MEDIA_INFO(us).lba_to_pba[zone] = lba_to_pba; in alauda_read_map()
677 MEDIA_INFO(us).pba_to_lba[zone] = pba_to_lba; in alauda_read_map()
678 result = 0; in alauda_read_map()
692 static void alauda_ensure_map_for_zone(struct us_data *us, unsigned int zone) in alauda_ensure_map_for_zone() argument
694 if (MEDIA_INFO(us).lba_to_pba[zone] == NULL in alauda_ensure_map_for_zone()
695 || MEDIA_INFO(us).pba_to_lba[zone] == NULL) in alauda_ensure_map_for_zone()
696 alauda_read_map(us, zone); in alauda_ensure_map_for_zone()
702 static int alauda_erase_block(struct us_data *us, u16 pba) in alauda_erase_block() argument
707 PBA_ZONE(pba), 0, PBA_LO(pba), 0x02, 0, MEDIA_PORT(us) in alauda_erase_block()
711 usb_stor_dbg(us, "Erasing PBA %d\n", pba); in alauda_erase_block()
713 rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, in alauda_erase_block()
718 rc = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, in alauda_erase_block()
723 usb_stor_dbg(us, "Erase result: %02X %02X\n", buf[0], buf[1]); in alauda_erase_block()
731 static int alauda_read_block_raw(struct us_data *us, u16 pba, in alauda_read_block_raw() argument
737 PBA_ZONE(pba), 0, PBA_LO(pba) + page, pages, 0, MEDIA_PORT(us) in alauda_read_block_raw()
740 usb_stor_dbg(us, "pba %d page %d count %d\n", pba, page, pages); in alauda_read_block_raw()
742 rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, in alauda_read_block_raw()
747 return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, in alauda_read_block_raw()
748 data, (MEDIA_INFO(us).pagesize + 64) * pages, NULL); in alauda_read_block_raw()
757 static int alauda_read_block(struct us_data *us, u16 pba, in alauda_read_block() argument
761 unsigned int pagesize = MEDIA_INFO(us).pagesize; in alauda_read_block()
763 rc = alauda_read_block_raw(us, pba, page, pages, data); in alauda_read_block()
768 for (i = 0; i < pages; i++) { in alauda_read_block()
782 static int alauda_write_block(struct us_data *us, u16 pba, unsigned char *data) in alauda_write_block() argument
785 struct alauda_info *info = (struct alauda_info *) us->extra; in alauda_write_block()
788 PBA_ZONE(pba), 0, PBA_LO(pba), 32, 0, MEDIA_PORT(us) in alauda_write_block()
791 usb_stor_dbg(us, "pba %d\n", pba); in alauda_write_block()
793 rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, in alauda_write_block()
798 rc = usb_stor_bulk_transfer_buf(us, info->wr_ep, data, in alauda_write_block()
799 (MEDIA_INFO(us).pagesize + 64) * MEDIA_INFO(us).blocksize, in alauda_write_block()
804 return alauda_check_status2(us); in alauda_write_block()
810 static int alauda_write_lba(struct us_data *us, u16 lba, in alauda_write_lba() argument
818 unsigned int uzonesize = MEDIA_INFO(us).uzonesize; in alauda_write_lba()
819 unsigned int zonesize = MEDIA_INFO(us).zonesize; in alauda_write_lba()
820 unsigned int pagesize = MEDIA_INFO(us).pagesize; in alauda_write_lba()
821 unsigned int blocksize = MEDIA_INFO(us).blocksize; in alauda_write_lba()
826 alauda_ensure_map_for_zone(us, zone); in alauda_write_lba()
828 pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset]; in alauda_write_lba()
839 new_pba = alauda_find_unused_pba(&MEDIA_INFO(us), zone); in alauda_write_lba()
848 result = alauda_read_block_raw(us, pba, 0, in alauda_write_lba()
853 memset(blockbuffer, 0, blocksize * (pagesize + 64)); in alauda_write_lba()
856 lbap = (lba_offset << 1) | 0x1000; in alauda_write_lba()
861 for (i = 0; i < blocksize; i++) { in alauda_write_lba()
866 usb_stor_dbg(us, "Warning: bad ecc in page %d- of pba %d\n", in alauda_write_lba()
872 usb_stor_dbg(us, "Warning: bad ecc in page %d+ of pba %d\n", in alauda_write_lba()
893 result = alauda_write_block(us, new_pba, blockbuffer); in alauda_write_lba()
898 MEDIA_INFO(us).pba_to_lba[zone][new_pba_offset] = lba; in alauda_write_lba()
899 MEDIA_INFO(us).lba_to_pba[zone][lba_offset] = new_pba; in alauda_write_lba()
900 usb_stor_dbg(us, "Remapped LBA %d to PBA %d\n", lba, new_pba); in alauda_write_lba()
904 result = alauda_erase_block(us, pba); in alauda_write_lba()
907 MEDIA_INFO(us).pba_to_lba[zone][pba_offset] = UNDEF; in alauda_write_lba()
916 static int alauda_read_data(struct us_data *us, unsigned long address, in alauda_read_data() argument
922 unsigned int blockshift = MEDIA_INFO(us).blockshift; in alauda_read_data()
923 unsigned int pageshift = MEDIA_INFO(us).pageshift; in alauda_read_data()
924 unsigned int blocksize = MEDIA_INFO(us).blocksize; in alauda_read_data()
925 unsigned int pagesize = MEDIA_INFO(us).pagesize; in alauda_read_data()
926 unsigned int uzonesize = MEDIA_INFO(us).uzonesize; in alauda_read_data()
945 page = (address & MEDIA_INFO(us).blockmask); in alauda_read_data()
946 max_lba = MEDIA_INFO(us).capacity >> (blockshift + pageshift); in alauda_read_data()
949 offset = 0; in alauda_read_data()
952 while (sectors > 0) { in alauda_read_data()
957 alauda_ensure_map_for_zone(us, zone); in alauda_read_data()
961 usb_stor_dbg(us, "Error: Requested lba %u exceeds maximum %u\n", in alauda_read_data()
972 pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset]; in alauda_read_data()
975 usb_stor_dbg(us, "Read %d zero pages (LBA %d) page %d\n", in alauda_read_data()
985 memset(buffer, 0, len); in alauda_read_data()
987 usb_stor_dbg(us, "Read %d pages, from PBA %d (LBA %d) page %d\n", in alauda_read_data()
990 result = alauda_read_block(us, pba, page, pages, buffer); in alauda_read_data()
996 usb_stor_access_xfer_buf(buffer, len, us->srb, in alauda_read_data()
999 page = 0; in alauda_read_data()
1011 static int alauda_write_data(struct us_data *us, unsigned long address, in alauda_write_data() argument
1016 unsigned int blockshift = MEDIA_INFO(us).blockshift; in alauda_write_data()
1017 unsigned int pageshift = MEDIA_INFO(us).pageshift; in alauda_write_data()
1018 unsigned int blocksize = MEDIA_INFO(us).blocksize; in alauda_write_data()
1019 unsigned int pagesize = MEDIA_INFO(us).pagesize; in alauda_write_data()
1047 page = (address & MEDIA_INFO(us).blockmask); in alauda_write_data()
1048 max_lba = MEDIA_INFO(us).capacity >> (pageshift + blockshift); in alauda_write_data()
1051 offset = 0; in alauda_write_data()
1054 while (sectors > 0) { in alauda_write_data()
1061 usb_stor_dbg(us, "Requested lba %u exceeds maximum %u\n", in alauda_write_data()
1068 usb_stor_access_xfer_buf(buffer, len, us->srb, in alauda_write_data()
1071 result = alauda_write_lba(us, lba, page, pages, buffer, in alauda_write_data()
1076 page = 0; in alauda_write_data()
1098 for (port = 0; port < 2; port++) { in alauda_info_destructor()
1110 static int init_alauda(struct us_data *us) in init_alauda() argument
1113 struct usb_host_interface *altsetting = us->pusb_intf->cur_altsetting; in init_alauda()
1116 us->extra = kzalloc(sizeof(struct alauda_info), GFP_NOIO); in init_alauda()
1117 if (!us->extra) in init_alauda()
1120 info = (struct alauda_info *) us->extra; in init_alauda()
1121 us->extra_destructor = alauda_info_destructor; in init_alauda()
1123 info->wr_ep = usb_sndbulkpipe(us->pusb_dev, in init_alauda()
1124 altsetting->endpoint[0].desc.bEndpointAddress in init_alauda()
1127 return 0; in init_alauda()
1130 static int alauda_transport(struct scsi_cmnd *srb, struct us_data *us) in alauda_transport() argument
1133 struct alauda_info *info = (struct alauda_info *) us->extra; in alauda_transport()
1134 unsigned char *ptr = us->iobuf; in alauda_transport()
1136 0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00 in alauda_transport()
1139 if (srb->cmnd[0] == INQUIRY) { in alauda_transport()
1140 usb_stor_dbg(us, "INQUIRY - Returning bogus response\n"); in alauda_transport()
1142 fill_inquiry_response(us, ptr, 36); in alauda_transport()
1146 if (srb->cmnd[0] == TEST_UNIT_READY) { in alauda_transport()
1147 usb_stor_dbg(us, "TEST_UNIT_READY\n"); in alauda_transport()
1148 return alauda_check_media(us); in alauda_transport()
1151 if (srb->cmnd[0] == READ_CAPACITY) { in alauda_transport()
1155 rc = alauda_check_media(us); in alauda_transport()
1159 num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift in alauda_transport()
1160 + MEDIA_INFO(us).blockshift + MEDIA_INFO(us).pageshift); in alauda_transport()
1162 capacity = num_zones * MEDIA_INFO(us).uzonesize in alauda_transport()
1163 * MEDIA_INFO(us).blocksize; in alauda_transport()
1166 ((__be32 *) ptr)[0] = cpu_to_be32(capacity - 1); in alauda_transport()
1173 if (srb->cmnd[0] == READ_10) { in alauda_transport()
1176 rc = alauda_check_media(us); in alauda_transport()
1185 usb_stor_dbg(us, "READ_10: page %d pagect %d\n", page, pages); in alauda_transport()
1187 return alauda_read_data(us, page, pages); in alauda_transport()
1190 if (srb->cmnd[0] == WRITE_10) { in alauda_transport()
1193 rc = alauda_check_media(us); in alauda_transport()
1202 usb_stor_dbg(us, "WRITE_10: page %d pagect %d\n", page, pages); in alauda_transport()
1204 return alauda_write_data(us, page, pages); in alauda_transport()
1207 if (srb->cmnd[0] == REQUEST_SENSE) { in alauda_transport()
1208 usb_stor_dbg(us, "REQUEST_SENSE\n"); in alauda_transport()
1210 memset(ptr, 0, 18); in alauda_transport()
1211 ptr[0] = 0xF0; in alauda_transport()
1221 if (srb->cmnd[0] == ALLOW_MEDIUM_REMOVAL) { in alauda_transport()
1229 usb_stor_dbg(us, "Gah! Unknown command: %d (0x%x)\n", in alauda_transport()
1230 srb->cmnd[0], srb->cmnd[0]); in alauda_transport()
1231 info->sense_key = 0x05; in alauda_transport()
1232 info->sense_asc = 0x20; in alauda_transport()
1233 info->sense_ascq = 0x00; in alauda_transport()
1242 struct us_data *us; in alauda_probe() local
1245 result = usb_stor_probe1(&us, intf, id, in alauda_probe()
1251 us->transport_name = "Alauda Control/Bulk"; in alauda_probe()
1252 us->transport = alauda_transport; in alauda_probe()
1253 us->transport_reset = usb_stor_Bulk_reset; in alauda_probe()
1254 us->max_lun = 1; in alauda_probe()
1256 result = usb_stor_probe2(us); in alauda_probe()