us 26 arch/alpha/lib/checksum.c unsigned short us[4]; us 34 arch/alpha/lib/checksum.c out_v.ul = (unsigned long) tmp_v.us[0] + (unsigned long) tmp_v.us[1] us 35 arch/alpha/lib/checksum.c + (unsigned long) tmp_v.us[2]; us 38 arch/alpha/lib/checksum.c return out_v.us[0] + out_v.us[1]; us 76 arch/alpha/lib/csum_partial_copy.c unsigned short us[4]; us 84 arch/alpha/lib/csum_partial_copy.c out_v.ul = (unsigned long) tmp_v.us[0] + (unsigned long) tmp_v.us[1] us 85 arch/alpha/lib/csum_partial_copy.c + (unsigned long) tmp_v.us[2]; us 88 arch/alpha/lib/csum_partial_copy.c return out_v.us[0] + out_v.us[1]; us 408 arch/ia64/include/asm/pal.h us : 1, /* Uncontained storage us 704 arch/ia64/include/asm/pal.h #define pmci_proc_uncontained_storage_damage pme_processor.us us 674 arch/ia64/kernel/mca_drv.c if (psp->us || psp->ci == 0) us 144 arch/mips/cavium-octeon/csrc-octeon.c void __udelay(unsigned long us) us 150 arch/mips/cavium-octeon/csrc-octeon.c inc = us * octeon_udelay_factor; us 18 arch/mips/include/asm/delay.h extern void __udelay(unsigned long us); us 21 arch/mips/include/asm/delay.h #define udelay(us) __udelay(us) us 51 arch/mips/lib/delay.c void __udelay(unsigned long us) us 55 arch/mips/lib/delay.c __delay((us * 0x000010c7ull * HZ * lpj) >> 32); us 7 arch/x86/boot/code16gcc.h # things around us. us 612 drivers/acpi/osl.c void acpi_os_stall(u32 us) us 614 drivers/acpi/osl.c while (us) { us 617 drivers/acpi/osl.c if (delay > us) us 618 drivers/acpi/osl.c delay = us; us 621 drivers/acpi/osl.c us -= delay; us 262 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static u64 us_to_bytes(struct amdgpu_device *adev, s64 us) us 264 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c if (us <= 0 || !adev->mm_stats.log2_max_MBps) us 270 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c return us << adev->mm_stats.log2_max_MBps; us 1103 drivers/gpu/drm/ast/ast_mode.c u16 us; us 1141 drivers/gpu/drm/ast/ast_mode.c writew(data16.us, dstxor); us 1142 drivers/gpu/drm/ast/ast_mode.c csum += (u32)data16.us; us 1213 drivers/gpu/drm/i915/display/vlv_dsi.c static u16 txclkesc(u32 divider, unsigned int us) us 1218 drivers/gpu/drm/i915/display/vlv_dsi.c return 20 * us; us 1220 drivers/gpu/drm/i915/display/vlv_dsi.c return 10 * us; us 1222 drivers/gpu/drm/i915/display/vlv_dsi.c return 5 * us; us 3911 drivers/gpu/drm/i915/i915_reg.h #define INTERVAL_1_28_US(us) roundup(((us) * 100) >> 7, 25) us 3912 drivers/gpu/drm/i915/i915_reg.h #define INTERVAL_1_33_US(us) (((us) * 3) >> 2) us 3913 drivers/gpu/drm/i915/i915_reg.h #define INTERVAL_0_833_US(us) (((us) * 6) / 5) us 3914 drivers/gpu/drm/i915/i915_reg.h #define GT_INTERVAL_FROM_US(dev_priv, us) (INTEL_GEN(dev_priv) >= 9 ? \ us 3916 drivers/gpu/drm/i915/i915_reg.h INTERVAL_0_833_US(us) : \ us 3917 drivers/gpu/drm/i915/i915_reg.h INTERVAL_1_33_US(us)) : \ us 3918 drivers/gpu/drm/i915/i915_reg.h INTERVAL_1_28_US(us)) us 7228 drivers/gpu/drm/i915/i915_reg.h #define MMIO_TIMEOUT_US(us) ((us) << 0) us 1056 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h struct vmw_marker_queue *queue, uint32_t us); us 121 drivers/gpu/drm/vmwgfx/vmwgfx_marker.c uint32_t us) us 123 drivers/gpu/drm/vmwgfx/vmwgfx_marker.c u64 cond = (u64) us * NSEC_PER_USEC; us 129 drivers/gpu/drm/vmwgfx/vmwgfx_marker.c struct vmw_marker_queue *queue, uint32_t us) us 135 drivers/gpu/drm/vmwgfx/vmwgfx_marker.c while (!vmw_lag_lt(queue, us)) { us 160 drivers/hwmon/applesmc.c int us; us 161 drivers/hwmon/applesmc.c for (us = APPLESMC_MIN_WAIT; us < APPLESMC_MAX_WAIT; us <<= 1) { us 162 drivers/hwmon/applesmc.c udelay(us); us 180 drivers/hwmon/applesmc.c int us; us 183 drivers/hwmon/applesmc.c for (us = APPLESMC_MIN_WAIT; us < APPLESMC_MAX_WAIT; us <<= 1) { us 184 drivers/hwmon/applesmc.c udelay(us); us 193 drivers/hwmon/applesmc.c if (us << 1 == APPLESMC_MAX_WAIT) us 823 drivers/iio/accel/mma8452.c int ret, us, power_mode; us 849 drivers/iio/accel/mma8452.c us = ret * mma8452_time_step_us[power_mode][ us 851 drivers/iio/accel/mma8452.c *val = us / USEC_PER_SEC; us 852 drivers/iio/accel/mma8452.c *val2 = us % USEC_PER_SEC; us 164 drivers/iio/accel/sca3000.c struct spi_device *us; us 281 drivers/iio/accel/sca3000.c return spi_write(st->us, st->tx, 2); us 299 drivers/iio/accel/sca3000.c return spi_sync_transfer(st->us, xfer, ARRAY_SIZE(xfer)); us 350 drivers/iio/accel/sca3000.c return spi_sync_transfer(st->us, xfer, ARRAY_SIZE(xfer)); us 981 drivers/iio/accel/sca3000.c ret = spi_sync_transfer(st->us, xfer, ARRAY_SIZE(xfer)); us 983 drivers/iio/accel/sca3000.c dev_err(&st->us->dev, "problem reading register\n"); us 1465 drivers/iio/accel/sca3000.c st->us = spi; us 55 drivers/iio/dac/ad5624r.h struct spi_device *us; us 75 drivers/iio/dac/ad5624r_spi.c return ad5624r_spi_write(st->us, us 141 drivers/iio/dac/ad5624r_spi.c ret = ad5624r_spi_write(st->us, AD5624R_CMD_POWERDOWN_DAC, 0, us 254 drivers/iio/dac/ad5624r_spi.c st->us = spi; us 43 drivers/iio/gyro/adis16080.c struct spi_device *us; us 67 drivers/iio/gyro/adis16080.c ret = spi_sync_transfer(st->us, t, ARRAY_SIZE(t)); us 200 drivers/iio/gyro/adis16080.c st->us = spi; us 40 drivers/iio/gyro/adis16130.c struct spi_device *us; us 60 drivers/iio/gyro/adis16130.c ret = spi_sync_transfer(st->us, &xfer, 1); us 153 drivers/iio/gyro/adis16130.c st->us = spi; us 74 drivers/iio/gyro/adxrs450.c struct spi_device *us; us 115 drivers/iio/gyro/adxrs450.c ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers)); us 117 drivers/iio/gyro/adxrs450.c dev_err(&st->us->dev, "problem while reading 16 bit register 0x%02x\n", us 151 drivers/iio/gyro/adxrs450.c ret = spi_write(st->us, &st->tx, sizeof(st->tx)); us 153 drivers/iio/gyro/adxrs450.c dev_err(&st->us->dev, "problem while writing 16 bit register 0x%02x\n", us 185 drivers/iio/gyro/adxrs450.c ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers)); us 187 drivers/iio/gyro/adxrs450.c dev_err(&st->us->dev, "Problem while reading sensor data\n"); us 221 drivers/iio/gyro/adxrs450.c ret = spi_sync_transfer(st->us, &xfers, 1); us 223 drivers/iio/gyro/adxrs450.c dev_err(&st->us->dev, "Problem while reading initializing data\n"); us 247 drivers/iio/gyro/adxrs450.c dev_warn(&st->us->dev, "The initial power on response is not correct! Restart without reset?\n"); us 259 drivers/iio/gyro/adxrs450.c dev_err(&st->us->dev, "The second response is not correct!\n"); us 267 drivers/iio/gyro/adxrs450.c dev_err(&st->us->dev, "The third response is not correct!\n"); us 275 drivers/iio/gyro/adxrs450.c dev_err(&st->us->dev, "The device is not in normal status!\n"); us 422 drivers/iio/gyro/adxrs450.c st->us = spi; us 104 drivers/iio/light/zopt2201.c unsigned long us; /* measurement time in micro seconds */ us 195 drivers/iio/light/zopt2201.c unsigned long t = zopt2201_resolution[data->res].us; us 295 drivers/iio/light/zopt2201.c *val2 = zopt2201_resolution[data->res].us; us 326 drivers/iio/light/zopt2201.c if (val2 == zopt2201_resolution[i].us) { us 440 drivers/iio/light/zopt2201.c zopt2201_resolution[i].us); us 160 drivers/infiniband/core/uverbs_std_types.c struct ib_usrq_object *us = us 163 drivers/infiniband/core/uverbs_std_types.c atomic_dec(&us->uxrcd->refcnt); us 112 drivers/leds/leds-max77693.c static u8 max77693_flash_timeout_to_reg(u32 us) us 114 drivers/leds/leds-max77693.c return (us - FLASH_TIMEOUT_MIN) / FLASH_TIMEOUT_STEP; us 149 drivers/md/bcache/io.c int us = t - b->submit_time_us; us 152 drivers/md/bcache/io.c if (us > (int) threshold) { us 153 drivers/md/bcache/io.c int ms = us / 1024; us 82 drivers/md/bcache/sysfs.c sysfs_time_stats_attribute(btree_split, sec, us); us 83 drivers/md/bcache/sysfs.c sysfs_time_stats_attribute(btree_sort, ms, us); us 84 drivers/md/bcache/sysfs.c sysfs_time_stats_attribute(btree_read, ms, us); us 721 drivers/md/bcache/sysfs.c sysfs_print_time_stats(&c->btree_split_time, btree_split, sec, us); us 722 drivers/md/bcache/sysfs.c sysfs_print_time_stats(&c->sort.time, btree_sort, ms, us); us 723 drivers/md/bcache/sysfs.c sysfs_print_time_stats(&c->btree_read_time, btree_read, ms, us); us 953 drivers/md/bcache/sysfs.c sysfs_time_stats_attribute_list(btree_split, sec, us) us 954 drivers/md/bcache/sysfs.c sysfs_time_stats_attribute_list(btree_sort, ms, us) us 955 drivers/md/bcache/sysfs.c sysfs_time_stats_attribute_list(btree_read, ms, us) us 427 drivers/media/i2c/tc358743_regs.h #define SET_PHY_AUTO_RST1_US(us) ((((us) / 200) << 4) & \ us 706 drivers/media/pci/saa7134/saa7134.h #define saa_wait(us) { udelay(us); } us 187 drivers/media/pci/tw68/tw68.h #define tw_wait(us) { udelay(us); } us 722 drivers/mmc/host/atmel-mci.c unsigned int us = DIV_ROUND_UP(ns, 1000); us 725 drivers/mmc/host/atmel-mci.c return us * (DIV_ROUND_UP(host->bus_hz, 2000000)); us 26 drivers/mtd/chips/cfi_util.c void cfi_udelay(int us) us 28 drivers/mtd/chips/cfi_util.c if (us >= 1000) { us 29 drivers/mtd/chips/cfi_util.c msleep((us+999)/1000); us 31 drivers/mtd/chips/cfi_util.c udelay(us); us 184 drivers/mtd/nand/raw/nandsim.c #define NS_UDELAY(us) \ us 185 drivers/mtd/nand/raw/nandsim.c do { if (do_delays) udelay(us); } while(0) us 186 drivers/mtd/nand/raw/nandsim.c #define NS_MDELAY(us) \ us 187 drivers/mtd/nand/raw/nandsim.c do { if (do_delays) mdelay(us); } while(0) us 134 drivers/mtd/parsers/sharpslpart.c u16 us; us 153 drivers/mtd/parsers/sharpslpart.c us = oob[good0] | oob[good1] << 8; us 156 drivers/mtd/parsers/sharpslpart.c if (hweight16(us) & BLOCK_UNMASK_COMPLEMENT) us 160 drivers/mtd/parsers/sharpslpart.c if (us == BLOCK_IS_RESERVED) us 163 drivers/mtd/parsers/sharpslpart.c return (us >> 1) & GENMASK(9, 0); us 626 drivers/net/ethernet/broadcom/tg3.c #define tw32_wait_f(reg, val, us) _tw32_flush(tp, (reg), (val), (us)) us 1480 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h unsigned int us) us 1482 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h return (us * adap->params.vpd.cclk) / 1000; us 1545 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h int cxgb4_set_rspq_intr_params(struct sge_rspq *q, unsigned int us, us 1548 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h unsigned int us, unsigned int cnt, us 1552 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h cxgb4_set_rspq_intr_params(q, us, cnt); us 873 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c unsigned int us, unsigned int cnt) us 881 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c err = cxgb4_set_rspq_intr_params(&q->rspq, us, cnt); us 1149 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c unsigned int us, unsigned int cnt) us 1153 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c if ((us | cnt) == 0) us 1175 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c us = us == 0 ? 6 : closest_timer(&adap->sge, us); us 1176 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c q->intr_params = QINTR_TIMER_IDX_V(us) | QINTR_CNT_EN_V(cnt > 0); us 1021 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c static int closest_timer(const struct sge *s, int us) us 1026 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c int delta = us - s->timer_val[i]; us 1078 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c unsigned int us, unsigned int cnt) us 1086 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c if ((us | cnt) == 0) us 1116 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c timer_idx = (us == 0 us 1118 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c : closest_timer(&adapter->sge, us)); us 315 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h unsigned int us) us 317 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h return (us * adapter->params.vpd.cclk) / 1000; us 2505 drivers/net/ethernet/freescale/fec_main.c static int fec_enet_us_to_itr_clock(struct net_device *ndev, int us) us 2509 drivers/net/ethernet/freescale/fec_main.c return us * (fep->itr_clk_rate / 64000) / 1000; us 3109 drivers/net/ethernet/marvell/sky2.c static inline u32 sky2_us2clk(const struct sky2_hw *hw, u32 us) us 3111 drivers/net/ethernet/marvell/sky2.c return sky2_mhz(hw) * us; us 3497 drivers/net/ethernet/via/via-velocity.c static void set_pending_timer_val(int *val, u32 us) us 3502 drivers/net/ethernet/via/via-velocity.c if (us >= 0x3f) { us 3506 drivers/net/ethernet/via/via-velocity.c if (us >= 0x3f * 4) { us 3510 drivers/net/ethernet/via/via-velocity.c if (us >= 0x3f * 16) { us 3515 drivers/net/ethernet/via/via-velocity.c *val = (mult << 6) | ((us >> shift) & 0x3f); us 1006 drivers/net/wireless/ath/ath9k/hw.c static void ath9k_hw_set_sifs_time(struct ath_hw *ah, u32 us) us 1008 drivers/net/wireless/ath/ath9k/hw.c u32 val = ath9k_hw_mac_to_clks(ah, us - 2); us 1013 drivers/net/wireless/ath/ath9k/hw.c void ath9k_hw_setslottime(struct ath_hw *ah, u32 us) us 1015 drivers/net/wireless/ath/ath9k/hw.c u32 val = ath9k_hw_mac_to_clks(ah, us); us 1020 drivers/net/wireless/ath/ath9k/hw.c void ath9k_hw_set_ack_timeout(struct ath_hw *ah, u32 us) us 1022 drivers/net/wireless/ath/ath9k/hw.c u32 val = ath9k_hw_mac_to_clks(ah, us); us 1027 drivers/net/wireless/ath/ath9k/hw.c void ath9k_hw_set_cts_timeout(struct ath_hw *ah, u32 us) us 1029 drivers/net/wireless/ath/ath9k/hw.c u32 val = ath9k_hw_mac_to_clks(ah, us); us 1151 drivers/net/wireless/ath/ath9k/hw.h void ath9k_hw_set_ack_timeout(struct ath_hw *ah, u32 us); us 1152 drivers/net/wireless/ath/ath9k/hw.h void ath9k_hw_set_cts_timeout(struct ath_hw *ah, u32 us); us 1153 drivers/net/wireless/ath/ath9k/hw.h void ath9k_hw_setslottime(struct ath_hw *ah, u32 us); us 16 drivers/net/wireless/broadcom/brcm80211/include/brcmu_utils.h #define SPINWAIT(exp, us) { \ us 17 drivers/net/wireless/broadcom/brcm80211/include/brcmu_utils.h uint countdown = (us) + 9; \ us 2320 drivers/regulator/core.c unsigned int us = delay % 1000; us 2328 drivers/regulator/core.c us += ms * 1000; us 2339 drivers/regulator/core.c if (us >= 10) us 2340 drivers/regulator/core.c usleep_range(us, us + 100); us 2342 drivers/regulator/core.c udelay(us); us 586 drivers/scsi/csiostor/csio_hw.h csio_us_to_core_ticks(struct csio_hw *hw, uint32_t us) us 588 drivers/scsi/csiostor/csio_hw.h return (us * hw->vpd.cclk) / 1000; us 3599 drivers/scsi/lpfc/lpfc_hw.h union sli_var us; us 1382 drivers/scsi/lpfc/lpfc_mbox.c phba->host_gp = &phba->mbox->us.s2.host[0]; us 1384 drivers/scsi/lpfc/lpfc_mbox.c offset = (uint8_t *)&phba->mbox->us.s2.host - us 1394 drivers/scsi/lpfc/lpfc_mbox.c phba->host_gp = &mb_slim->us.s3.host[0]; us 1395 drivers/scsi/lpfc/lpfc_mbox.c phba->hbq_put = &mb_slim->us.s3.hbq_put[0]; us 1397 drivers/scsi/lpfc/lpfc_mbox.c phba->host_gp = &mb_slim->us.s2.host[0]; us 1421 drivers/scsi/lpfc/lpfc_mbox.c mbx.us.s3_pgp.port); us 1423 drivers/scsi/lpfc/lpfc_mbox.c pgp_offset = offsetof(struct lpfc_sli2_slim, mbx.us.s2.port); us 5024 drivers/scsi/lpfc/lpfc_sli.c phba->hbq_get = phba->mbox->us.s3_pgp.hbq_get; us 5025 drivers/scsi/lpfc/lpfc_sli.c phba->port_gp = phba->mbox->us.s3_pgp.port; us 5038 drivers/scsi/lpfc/lpfc_sli.c phba->port_gp = phba->mbox->us.s2.port; us 196 drivers/spi/spi-sprd.c u32 val, us; us 199 drivers/spi/spi-sprd.c us = sprd_spi_transfer_max_timeout(ss, t); us 201 drivers/spi/spi-sprd.c val & SPRD_SPI_TX_END_IRQ, 0, us); us 208 drivers/spi/spi-sprd.c !(val & SPRD_SPI_TX_BUSY), 0, us); us 221 drivers/spi/spi-sprd.c u32 val, us; us 224 drivers/spi/spi-sprd.c us = sprd_spi_transfer_max_timeout(ss, t); us 226 drivers/spi/spi-sprd.c val & SPRD_SPI_RX_END_IRQ, 0, us); us 27 drivers/spi/spi-tle62x0.c struct spi_device *us; us 52 drivers/spi/spi-tle62x0.c dev_dbg(&st->us->dev, "buff %3ph\n", buff); us 54 drivers/spi/spi-tle62x0.c return spi_write(st->us, buff, (st->nr_gpio == 16) ? 3 : 2); us 75 drivers/spi/spi-tle62x0.c return spi_sync(st->us, &msg); us 256 drivers/spi/spi-tle62x0.c st->us = spi; us 1100 drivers/spi/spi.c u32 us = DIV_ROUND_UP(ns, 1000); us 1102 drivers/spi/spi.c if (us <= 10) us 1103 drivers/spi/spi.c udelay(us); us 1105 drivers/spi/spi.c usleep_range(us, us + DIV_ROUND_UP(us, 10)); us 978 drivers/staging/comedi/comedi_fops.c struct comedi_subdinfo *tmp, *us; us 989 drivers/staging/comedi/comedi_fops.c us = tmp + i; us 991 drivers/staging/comedi/comedi_fops.c us->type = s->type; us 992 drivers/staging/comedi/comedi_fops.c us->n_chan = s->n_chan; us 993 drivers/staging/comedi/comedi_fops.c us->subd_flags = s->subdev_flags; us 995 drivers/staging/comedi/comedi_fops.c us->subd_flags |= SDF_RUNNING; us 997 drivers/staging/comedi/comedi_fops.c us->timer_type = TIMER_nanosec; us 998 drivers/staging/comedi/comedi_fops.c us->len_chanlist = s->len_chanlist; us 999 drivers/staging/comedi/comedi_fops.c us->maxdata = s->maxdata; us 1001 drivers/staging/comedi/comedi_fops.c us->range_type = us 1004 drivers/staging/comedi/comedi_fops.c us->range_type = 0; /* XXX */ us 1008 drivers/staging/comedi/comedi_fops.c us->subd_flags |= SDF_BUSY; us 1010 drivers/staging/comedi/comedi_fops.c us->subd_flags |= SDF_BUSY_OWNER; us 1012 drivers/staging/comedi/comedi_fops.c us->subd_flags |= SDF_LOCKED; us 1014 drivers/staging/comedi/comedi_fops.c us->subd_flags |= SDF_LOCK_OWNER; us 1016 drivers/staging/comedi/comedi_fops.c us->subd_flags |= SDF_MAXDATA; us 1018 drivers/staging/comedi/comedi_fops.c us->subd_flags |= SDF_RANGETYPE; us 1020 drivers/staging/comedi/comedi_fops.c us->subd_flags |= SDF_CMD; us 1023 drivers/staging/comedi/comedi_fops.c us->insn_bits_support = COMEDI_SUPPORTED; us 1025 drivers/staging/comedi/comedi_fops.c us->insn_bits_support = COMEDI_UNSUPPORTED; us 825 drivers/usb/dwc2/core.h #define DWC2_ROUND_US_TO_SLICE(us) \ us 826 drivers/usb/dwc2/core.h (DIV_ROUND_UP((us), DWC2_US_PER_SLICE) * \ us 1436 drivers/usb/dwc2/core.h int dwc2_hcd_get_future_frame_number(struct dwc2_hsotg *hsotg, int us); us 1453 drivers/usb/dwc2/core.h int us) us 3765 drivers/usb/dwc2/hcd.c int dwc2_hcd_get_future_frame_number(struct dwc2_hsotg *hsotg, int us) us 3789 drivers/usb/dwc2/hcd.c DIV_ROUND_UP(interval * us, us_per_frame); us 662 drivers/usb/dwc2/hcd_queue.c int us; us 664 drivers/usb/dwc2/hcd_queue.c us = pmap_schedule(hsotg->hs_periodic_bitmap, us 670 drivers/usb/dwc2/hcd_queue.c if (us < 0) us 671 drivers/usb/dwc2/hcd_queue.c return us; us 673 drivers/usb/dwc2/hcd_queue.c trans_time->start_schedule_us = us; us 610 drivers/usb/gadget/function/f_acm.c struct usb_string *us; us 619 drivers/usb/gadget/function/f_acm.c us = usb_gstrings_attach(cdev, acm_strings, us 621 drivers/usb/gadget/function/f_acm.c if (IS_ERR(us)) us 622 drivers/usb/gadget/function/f_acm.c return PTR_ERR(us); us 623 drivers/usb/gadget/function/f_acm.c acm_control_interface_desc.iInterface = us[ACM_CTRL_IDX].id; us 624 drivers/usb/gadget/function/f_acm.c acm_data_interface_desc.iInterface = us[ACM_DATA_IDX].id; us 625 drivers/usb/gadget/function/f_acm.c acm_iad_descriptor.iFunction = us[ACM_IAD_IDX].id; us 687 drivers/usb/gadget/function/f_ecm.c struct usb_string *us; us 717 drivers/usb/gadget/function/f_ecm.c us = usb_gstrings_attach(cdev, ecm_strings, us 719 drivers/usb/gadget/function/f_ecm.c if (IS_ERR(us)) us 720 drivers/usb/gadget/function/f_ecm.c return PTR_ERR(us); us 721 drivers/usb/gadget/function/f_ecm.c ecm_control_intf.iInterface = us[0].id; us 722 drivers/usb/gadget/function/f_ecm.c ecm_data_intf.iInterface = us[2].id; us 723 drivers/usb/gadget/function/f_ecm.c ecm_desc.iMACAddress = us[1].id; us 724 drivers/usb/gadget/function/f_ecm.c ecm_iad_descriptor.iFunction = us[3].id; us 244 drivers/usb/gadget/function/f_eem.c struct usb_string *us; us 268 drivers/usb/gadget/function/f_eem.c us = usb_gstrings_attach(cdev, eem_strings, us 270 drivers/usb/gadget/function/f_eem.c if (IS_ERR(us)) us 271 drivers/usb/gadget/function/f_eem.c return PTR_ERR(us); us 272 drivers/usb/gadget/function/f_eem.c eem_intf.iInterface = us[0].id; us 748 drivers/usb/gadget/function/f_hid.c struct usb_string *us; us 754 drivers/usb/gadget/function/f_hid.c us = usb_gstrings_attach(c->cdev, ct_func_strings, us 756 drivers/usb/gadget/function/f_hid.c if (IS_ERR(us)) us 757 drivers/usb/gadget/function/f_hid.c return PTR_ERR(us); us 758 drivers/usb/gadget/function/f_hid.c hidg_interface_desc.iInterface = us[CT_FUNC_HID_IDX].id; us 2682 drivers/usb/gadget/function/f_mass_storage.c struct usb_string *us; us 2689 drivers/usb/gadget/function/f_mass_storage.c us = usb_gstrings_attach(cdev, fsg_strings_array, us 2691 drivers/usb/gadget/function/f_mass_storage.c if (IS_ERR(us)) us 2692 drivers/usb/gadget/function/f_mass_storage.c return PTR_ERR(us); us 2694 drivers/usb/gadget/function/f_mass_storage.c fsg_intf_desc.iInterface = us[FSG_STRING_INTERFACE].id; us 874 drivers/usb/gadget/function/f_midi.c struct usb_string *us; us 884 drivers/usb/gadget/function/f_midi.c us = usb_gstrings_attach(c->cdev, midi_strings, us 886 drivers/usb/gadget/function/f_midi.c if (IS_ERR(us)) { us 887 drivers/usb/gadget/function/f_midi.c status = PTR_ERR(us); us 890 drivers/usb/gadget/function/f_midi.c ac_interface_desc.iInterface = us[STRING_FUNC_IDX].id; us 1390 drivers/usb/gadget/function/f_ncm.c struct usb_string *us; us 1425 drivers/usb/gadget/function/f_ncm.c us = usb_gstrings_attach(cdev, ncm_strings, us 1427 drivers/usb/gadget/function/f_ncm.c if (IS_ERR(us)) { us 1428 drivers/usb/gadget/function/f_ncm.c status = PTR_ERR(us); us 1431 drivers/usb/gadget/function/f_ncm.c ncm_control_intf.iInterface = us[STRING_CTRL_IDX].id; us 1432 drivers/usb/gadget/function/f_ncm.c ncm_data_nop_intf.iInterface = us[STRING_DATA_IDX].id; us 1433 drivers/usb/gadget/function/f_ncm.c ncm_data_intf.iInterface = us[STRING_DATA_IDX].id; us 1434 drivers/usb/gadget/function/f_ncm.c ecm_desc.iMACAddress = us[STRING_MAC_IDX].id; us 1435 drivers/usb/gadget/function/f_ncm.c ncm_iad_desc.iFunction = us[STRING_IAD_IDX].id; us 306 drivers/usb/gadget/function/f_obex.c struct usb_string *us; us 313 drivers/usb/gadget/function/f_obex.c us = usb_gstrings_attach(cdev, obex_strings, us 315 drivers/usb/gadget/function/f_obex.c if (IS_ERR(us)) us 316 drivers/usb/gadget/function/f_obex.c return PTR_ERR(us); us 317 drivers/usb/gadget/function/f_obex.c obex_control_intf.iInterface = us[OBEX_CTRL_IDX].id; us 318 drivers/usb/gadget/function/f_obex.c obex_data_nop_intf.iInterface = us[OBEX_DATA_IDX].id; us 319 drivers/usb/gadget/function/f_obex.c obex_data_intf.iInterface = us[OBEX_DATA_IDX].id; us 671 drivers/usb/gadget/function/f_rndis.c struct usb_string *us; us 710 drivers/usb/gadget/function/f_rndis.c us = usb_gstrings_attach(cdev, rndis_strings, us 712 drivers/usb/gadget/function/f_rndis.c if (IS_ERR(us)) { us 713 drivers/usb/gadget/function/f_rndis.c status = PTR_ERR(us); us 716 drivers/usb/gadget/function/f_rndis.c rndis_control_intf.iInterface = us[0].id; us 717 drivers/usb/gadget/function/f_rndis.c rndis_data_intf.iInterface = us[1].id; us 718 drivers/usb/gadget/function/f_rndis.c rndis_iad_descriptor.iFunction = us[2].id; us 296 drivers/usb/gadget/function/f_subset.c struct usb_string *us; us 321 drivers/usb/gadget/function/f_subset.c us = usb_gstrings_attach(cdev, geth_strings, us 323 drivers/usb/gadget/function/f_subset.c if (IS_ERR(us)) us 324 drivers/usb/gadget/function/f_subset.c return PTR_ERR(us); us 326 drivers/usb/gadget/function/f_subset.c subset_data_intf.iInterface = us[0].id; us 327 drivers/usb/gadget/function/f_subset.c ether_desc.iMACAddress = us[1].id; us 1990 drivers/usb/gadget/function/f_tcm.c struct usb_string *us; us 2005 drivers/usb/gadget/function/f_tcm.c us = usb_gstrings_attach(c->cdev, tcm_strings, us 2007 drivers/usb/gadget/function/f_tcm.c if (IS_ERR(us)) us 2008 drivers/usb/gadget/function/f_tcm.c return PTR_ERR(us); us 2009 drivers/usb/gadget/function/f_tcm.c bot_intf_desc.iInterface = us[USB_G_STR_INT_BBB].id; us 2010 drivers/usb/gadget/function/f_tcm.c uasp_intf_desc.iInterface = us[USB_G_STR_INT_UAS].id; us 516 drivers/usb/gadget/function/f_uac1.c struct usb_string *us; us 523 drivers/usb/gadget/function/f_uac1.c us = usb_gstrings_attach(cdev, uac1_strings, ARRAY_SIZE(strings_uac1)); us 524 drivers/usb/gadget/function/f_uac1.c if (IS_ERR(us)) us 525 drivers/usb/gadget/function/f_uac1.c return PTR_ERR(us); us 526 drivers/usb/gadget/function/f_uac1.c ac_interface_desc.iInterface = us[STR_AC_IF].id; us 527 drivers/usb/gadget/function/f_uac1.c usb_out_it_desc.iTerminal = us[STR_USB_OUT_IT].id; us 528 drivers/usb/gadget/function/f_uac1.c usb_out_it_desc.iChannelNames = us[STR_USB_OUT_IT_CH_NAMES].id; us 529 drivers/usb/gadget/function/f_uac1.c io_out_ot_desc.iTerminal = us[STR_IO_OUT_OT].id; us 530 drivers/usb/gadget/function/f_uac1.c as_out_interface_alt_0_desc.iInterface = us[STR_AS_OUT_IF_ALT0].id; us 531 drivers/usb/gadget/function/f_uac1.c as_out_interface_alt_1_desc.iInterface = us[STR_AS_OUT_IF_ALT1].id; us 532 drivers/usb/gadget/function/f_uac1.c io_in_it_desc.iTerminal = us[STR_IO_IN_IT].id; us 533 drivers/usb/gadget/function/f_uac1.c io_in_it_desc.iChannelNames = us[STR_IO_IN_IT_CH_NAMES].id; us 534 drivers/usb/gadget/function/f_uac1.c usb_in_ot_desc.iTerminal = us[STR_USB_IN_OT].id; us 535 drivers/usb/gadget/function/f_uac1.c as_in_interface_alt_0_desc.iInterface = us[STR_AS_IN_IF_ALT0].id; us 536 drivers/usb/gadget/function/f_uac1.c as_in_interface_alt_1_desc.iInterface = us[STR_AS_IN_IF_ALT1].id; us 702 drivers/usb/gadget/function/f_uac1_legacy.c struct usb_string *us; us 716 drivers/usb/gadget/function/f_uac1_legacy.c us = usb_gstrings_attach(cdev, uac1_strings, ARRAY_SIZE(strings_uac1)); us 717 drivers/usb/gadget/function/f_uac1_legacy.c if (IS_ERR(us)) us 718 drivers/usb/gadget/function/f_uac1_legacy.c return PTR_ERR(us); us 719 drivers/usb/gadget/function/f_uac1_legacy.c ac_interface_desc.iInterface = us[STR_AC_IF].id; us 720 drivers/usb/gadget/function/f_uac1_legacy.c input_terminal_desc.iTerminal = us[STR_INPUT_TERMINAL].id; us 721 drivers/usb/gadget/function/f_uac1_legacy.c input_terminal_desc.iChannelNames = us[STR_INPUT_TERMINAL_CH_NAMES].id; us 722 drivers/usb/gadget/function/f_uac1_legacy.c feature_unit_desc.iFeature = us[STR_FEAT_DESC_0].id; us 723 drivers/usb/gadget/function/f_uac1_legacy.c output_terminal_desc.iTerminal = us[STR_OUTPUT_TERMINAL].id; us 724 drivers/usb/gadget/function/f_uac1_legacy.c as_interface_alt_0_desc.iInterface = us[STR_AS_IF_ALT0].id; us 725 drivers/usb/gadget/function/f_uac1_legacy.c as_interface_alt_1_desc.iInterface = us[STR_AS_IF_ALT1].id; us 601 drivers/usb/gadget/function/f_uac2.c struct usb_string *us; us 606 drivers/usb/gadget/function/f_uac2.c us = usb_gstrings_attach(cdev, fn_strings, ARRAY_SIZE(strings_fn)); us 607 drivers/usb/gadget/function/f_uac2.c if (IS_ERR(us)) us 608 drivers/usb/gadget/function/f_uac2.c return PTR_ERR(us); us 609 drivers/usb/gadget/function/f_uac2.c iad_desc.iFunction = us[STR_ASSOC].id; us 610 drivers/usb/gadget/function/f_uac2.c std_ac_if_desc.iInterface = us[STR_IF_CTRL].id; us 611 drivers/usb/gadget/function/f_uac2.c in_clk_src_desc.iClockSource = us[STR_CLKSRC_IN].id; us 612 drivers/usb/gadget/function/f_uac2.c out_clk_src_desc.iClockSource = us[STR_CLKSRC_OUT].id; us 613 drivers/usb/gadget/function/f_uac2.c usb_out_it_desc.iTerminal = us[STR_USB_IT].id; us 614 drivers/usb/gadget/function/f_uac2.c io_in_it_desc.iTerminal = us[STR_IO_IT].id; us 615 drivers/usb/gadget/function/f_uac2.c usb_in_ot_desc.iTerminal = us[STR_USB_OT].id; us 616 drivers/usb/gadget/function/f_uac2.c io_out_ot_desc.iTerminal = us[STR_IO_OT].id; us 617 drivers/usb/gadget/function/f_uac2.c std_as_out_if0_desc.iInterface = us[STR_AS_OUT_ALT0].id; us 618 drivers/usb/gadget/function/f_uac2.c std_as_out_if1_desc.iInterface = us[STR_AS_OUT_ALT1].id; us 619 drivers/usb/gadget/function/f_uac2.c std_as_in_if0_desc.iInterface = us[STR_AS_IN_ALT0].id; us 620 drivers/usb/gadget/function/f_uac2.c std_as_in_if1_desc.iInterface = us[STR_AS_IN_ALT1].id; us 589 drivers/usb/gadget/function/f_uvc.c struct usb_string *us; us 672 drivers/usb/gadget/function/f_uvc.c us = usb_gstrings_attach(cdev, uvc_function_strings, us 674 drivers/usb/gadget/function/f_uvc.c if (IS_ERR(us)) { us 675 drivers/usb/gadget/function/f_uvc.c ret = PTR_ERR(us); us 678 drivers/usb/gadget/function/f_uvc.c uvc_iad.iFunction = us[UVC_STRING_CONTROL_IDX].id; us 679 drivers/usb/gadget/function/f_uvc.c uvc_control_intf.iInterface = us[UVC_STRING_CONTROL_IDX].id; us 680 drivers/usb/gadget/function/f_uvc.c ret = us[UVC_STRING_STREAMING_IDX].id; us 114 drivers/usb/storage/alauda.c #define MEDIA_PORT(us) us->srb->device->lun us 115 drivers/usb/storage/alauda.c #define MEDIA_INFO(us) ((struct alauda_info *)us->extra)->port[MEDIA_PORT(us)] us 121 drivers/usb/storage/alauda.c static int init_alauda(struct us_data *us); us 308 drivers/usb/storage/alauda.c static int alauda_get_media_status(struct us_data *us, unsigned char *data) us 313 drivers/usb/storage/alauda.c if (MEDIA_PORT(us) == ALAUDA_PORT_XD) us 318 drivers/usb/storage/alauda.c rc = usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, us 321 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Media status %02X %02X\n", data[0], data[1]); us 330 drivers/usb/storage/alauda.c static int alauda_ack_media(struct us_data *us) us 334 drivers/usb/storage/alauda.c if (MEDIA_PORT(us) == ALAUDA_PORT_XD) us 339 drivers/usb/storage/alauda.c return usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, us 347 drivers/usb/storage/alauda.c static int alauda_get_media_signature(struct us_data *us, unsigned char *data) us 351 drivers/usb/storage/alauda.c if (MEDIA_PORT(us) == ALAUDA_PORT_XD) us 356 drivers/usb/storage/alauda.c return usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, us 363 drivers/usb/storage/alauda.c static int alauda_reset_media(struct us_data *us) us 365 drivers/usb/storage/alauda.c unsigned char *command = us->iobuf; us 370 drivers/usb/storage/alauda.c command[8] = MEDIA_PORT(us); us 372 drivers/usb/storage/alauda.c return usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 379 drivers/usb/storage/alauda.c static int alauda_init_media(struct us_data *us) us 381 drivers/usb/storage/alauda.c unsigned char *data = us->iobuf; us 389 drivers/usb/storage/alauda.c if (alauda_get_media_status(us, data) != USB_STOR_XFER_GOOD) us 396 drivers/usb/storage/alauda.c usb_stor_dbg(us, "We are ready for action!\n"); us 398 drivers/usb/storage/alauda.c if (alauda_ack_media(us) != USB_STOR_XFER_GOOD) us 403 drivers/usb/storage/alauda.c if (alauda_get_media_status(us, data) != USB_STOR_XFER_GOOD) us 407 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Media not ready after ack\n"); us 411 drivers/usb/storage/alauda.c if (alauda_get_media_signature(us, data) != USB_STOR_XFER_GOOD) us 414 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Media signature: %4ph\n", data); us 422 drivers/usb/storage/alauda.c MEDIA_INFO(us).capacity = 1 << media_info->chipshift; us 423 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Found media with capacity: %ldMB\n", us 424 drivers/usb/storage/alauda.c MEDIA_INFO(us).capacity >> 20); us 426 drivers/usb/storage/alauda.c MEDIA_INFO(us).pageshift = media_info->pageshift; us 427 drivers/usb/storage/alauda.c MEDIA_INFO(us).blockshift = media_info->blockshift; us 428 drivers/usb/storage/alauda.c MEDIA_INFO(us).zoneshift = media_info->zoneshift; us 430 drivers/usb/storage/alauda.c MEDIA_INFO(us).pagesize = 1 << media_info->pageshift; us 431 drivers/usb/storage/alauda.c MEDIA_INFO(us).blocksize = 1 << media_info->blockshift; us 432 drivers/usb/storage/alauda.c MEDIA_INFO(us).zonesize = 1 << media_info->zoneshift; us 434 drivers/usb/storage/alauda.c MEDIA_INFO(us).uzonesize = ((1 << media_info->zoneshift) / 128) * 125; us 435 drivers/usb/storage/alauda.c MEDIA_INFO(us).blockmask = MEDIA_INFO(us).blocksize - 1; us 437 drivers/usb/storage/alauda.c num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift us 438 drivers/usb/storage/alauda.c + MEDIA_INFO(us).blockshift + MEDIA_INFO(us).pageshift); us 439 drivers/usb/storage/alauda.c MEDIA_INFO(us).pba_to_lba = kcalloc(num_zones, sizeof(u16*), GFP_NOIO); us 440 drivers/usb/storage/alauda.c MEDIA_INFO(us).lba_to_pba = kcalloc(num_zones, sizeof(u16*), GFP_NOIO); us 442 drivers/usb/storage/alauda.c if (alauda_reset_media(us) != USB_STOR_XFER_GOOD) us 452 drivers/usb/storage/alauda.c static int alauda_check_media(struct us_data *us) us 454 drivers/usb/storage/alauda.c struct alauda_info *info = (struct alauda_info *) us->extra; us 458 drivers/usb/storage/alauda.c rc = alauda_get_media_status(us, status); us 463 drivers/usb/storage/alauda.c usb_stor_dbg(us, "No media, or door open\n"); us 464 drivers/usb/storage/alauda.c alauda_free_maps(&MEDIA_INFO(us)); us 473 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Media change detected\n"); us 474 drivers/usb/storage/alauda.c alauda_free_maps(&MEDIA_INFO(us)); us 475 drivers/usb/storage/alauda.c alauda_init_media(us); us 490 drivers/usb/storage/alauda.c static int alauda_check_status2(struct us_data *us) us 495 drivers/usb/storage/alauda.c 0, 0, 0, 0, 3, 0, MEDIA_PORT(us) us 499 drivers/usb/storage/alauda.c rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 504 drivers/usb/storage/alauda.c rc = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 509 drivers/usb/storage/alauda.c usb_stor_dbg(us, "%3ph\n", data); us 520 drivers/usb/storage/alauda.c static int alauda_get_redu_data(struct us_data *us, u16 pba, unsigned char *data) us 525 drivers/usb/storage/alauda.c PBA_HI(pba), PBA_ZONE(pba), 0, PBA_LO(pba), 0, 0, MEDIA_PORT(us) us 528 drivers/usb/storage/alauda.c rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 533 drivers/usb/storage/alauda.c return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 558 drivers/usb/storage/alauda.c static int alauda_read_map(struct us_data *us, unsigned int zone) us 560 drivers/usb/storage/alauda.c unsigned char *data = us->iobuf; us 563 drivers/usb/storage/alauda.c unsigned int zonesize = MEDIA_INFO(us).zonesize; us 564 drivers/usb/storage/alauda.c unsigned int uzonesize = MEDIA_INFO(us).uzonesize; us 575 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Mapping blocks for zone %d\n", zone); us 584 drivers/usb/storage/alauda.c result = alauda_get_redu_data(us, blocknum, data); us 595 drivers/usb/storage/alauda.c usb_stor_dbg(us, "PBA %d has no logical mapping\n", blocknum); us 608 drivers/usb/storage/alauda.c usb_stor_dbg(us, "PBA %d has no logical mapping: reserved area = %02X%02X%02X%02X data status %02X block status %02X\n", us 617 drivers/usb/storage/alauda.c usb_stor_dbg(us, "PBA %d has invalid address field %02X%02X/%02X%02X\n", us 666 drivers/usb/storage/alauda.c MEDIA_INFO(us).lba_to_pba[zone] = lba_to_pba; us 667 drivers/usb/storage/alauda.c MEDIA_INFO(us).pba_to_lba[zone] = pba_to_lba; us 682 drivers/usb/storage/alauda.c static void alauda_ensure_map_for_zone(struct us_data *us, unsigned int zone) us 684 drivers/usb/storage/alauda.c if (MEDIA_INFO(us).lba_to_pba[zone] == NULL us 685 drivers/usb/storage/alauda.c || MEDIA_INFO(us).pba_to_lba[zone] == NULL) us 686 drivers/usb/storage/alauda.c alauda_read_map(us, zone); us 692 drivers/usb/storage/alauda.c static int alauda_erase_block(struct us_data *us, u16 pba) us 697 drivers/usb/storage/alauda.c PBA_ZONE(pba), 0, PBA_LO(pba), 0x02, 0, MEDIA_PORT(us) us 701 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Erasing PBA %d\n", pba); us 703 drivers/usb/storage/alauda.c rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 708 drivers/usb/storage/alauda.c rc = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 713 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Erase result: %02X %02X\n", buf[0], buf[1]); us 721 drivers/usb/storage/alauda.c static int alauda_read_block_raw(struct us_data *us, u16 pba, us 727 drivers/usb/storage/alauda.c PBA_ZONE(pba), 0, PBA_LO(pba) + page, pages, 0, MEDIA_PORT(us) us 730 drivers/usb/storage/alauda.c usb_stor_dbg(us, "pba %d page %d count %d\n", pba, page, pages); us 732 drivers/usb/storage/alauda.c rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 737 drivers/usb/storage/alauda.c return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 738 drivers/usb/storage/alauda.c data, (MEDIA_INFO(us).pagesize + 64) * pages, NULL); us 747 drivers/usb/storage/alauda.c static int alauda_read_block(struct us_data *us, u16 pba, us 751 drivers/usb/storage/alauda.c unsigned int pagesize = MEDIA_INFO(us).pagesize; us 753 drivers/usb/storage/alauda.c rc = alauda_read_block_raw(us, pba, page, pages, data); us 772 drivers/usb/storage/alauda.c static int alauda_write_block(struct us_data *us, u16 pba, unsigned char *data) us 775 drivers/usb/storage/alauda.c struct alauda_info *info = (struct alauda_info *) us->extra; us 778 drivers/usb/storage/alauda.c PBA_ZONE(pba), 0, PBA_LO(pba), 32, 0, MEDIA_PORT(us) us 781 drivers/usb/storage/alauda.c usb_stor_dbg(us, "pba %d\n", pba); us 783 drivers/usb/storage/alauda.c rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 788 drivers/usb/storage/alauda.c rc = usb_stor_bulk_transfer_buf(us, info->wr_ep, data, us 789 drivers/usb/storage/alauda.c (MEDIA_INFO(us).pagesize + 64) * MEDIA_INFO(us).blocksize, us 794 drivers/usb/storage/alauda.c return alauda_check_status2(us); us 800 drivers/usb/storage/alauda.c static int alauda_write_lba(struct us_data *us, u16 lba, us 808 drivers/usb/storage/alauda.c unsigned int uzonesize = MEDIA_INFO(us).uzonesize; us 809 drivers/usb/storage/alauda.c unsigned int zonesize = MEDIA_INFO(us).zonesize; us 810 drivers/usb/storage/alauda.c unsigned int pagesize = MEDIA_INFO(us).pagesize; us 811 drivers/usb/storage/alauda.c unsigned int blocksize = MEDIA_INFO(us).blocksize; us 816 drivers/usb/storage/alauda.c alauda_ensure_map_for_zone(us, zone); us 818 drivers/usb/storage/alauda.c pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset]; us 829 drivers/usb/storage/alauda.c new_pba = alauda_find_unused_pba(&MEDIA_INFO(us), zone); us 838 drivers/usb/storage/alauda.c result = alauda_read_block_raw(us, pba, 0, us 856 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Warning: bad ecc in page %d- of pba %d\n", us 862 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Warning: bad ecc in page %d+ of pba %d\n", us 883 drivers/usb/storage/alauda.c result = alauda_write_block(us, new_pba, blockbuffer); us 888 drivers/usb/storage/alauda.c MEDIA_INFO(us).pba_to_lba[zone][new_pba_offset] = lba; us 889 drivers/usb/storage/alauda.c MEDIA_INFO(us).lba_to_pba[zone][lba_offset] = new_pba; us 890 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Remapped LBA %d to PBA %d\n", lba, new_pba); us 894 drivers/usb/storage/alauda.c result = alauda_erase_block(us, pba); us 897 drivers/usb/storage/alauda.c MEDIA_INFO(us).pba_to_lba[zone][pba_offset] = UNDEF; us 906 drivers/usb/storage/alauda.c static int alauda_read_data(struct us_data *us, unsigned long address, us 912 drivers/usb/storage/alauda.c unsigned int blockshift = MEDIA_INFO(us).blockshift; us 913 drivers/usb/storage/alauda.c unsigned int pageshift = MEDIA_INFO(us).pageshift; us 914 drivers/usb/storage/alauda.c unsigned int blocksize = MEDIA_INFO(us).blocksize; us 915 drivers/usb/storage/alauda.c unsigned int pagesize = MEDIA_INFO(us).pagesize; us 916 drivers/usb/storage/alauda.c unsigned int uzonesize = MEDIA_INFO(us).uzonesize; us 935 drivers/usb/storage/alauda.c page = (address & MEDIA_INFO(us).blockmask); us 936 drivers/usb/storage/alauda.c max_lba = MEDIA_INFO(us).capacity >> (blockshift + pageshift); us 947 drivers/usb/storage/alauda.c alauda_ensure_map_for_zone(us, zone); us 951 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Error: Requested lba %u exceeds maximum %u\n", us 962 drivers/usb/storage/alauda.c pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset]; us 965 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Read %d zero pages (LBA %d) page %d\n", us 977 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Read %d pages, from PBA %d (LBA %d) page %d\n", us 980 drivers/usb/storage/alauda.c result = alauda_read_block(us, pba, page, pages, buffer); us 986 drivers/usb/storage/alauda.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 1001 drivers/usb/storage/alauda.c static int alauda_write_data(struct us_data *us, unsigned long address, us 1006 drivers/usb/storage/alauda.c unsigned int blockshift = MEDIA_INFO(us).blockshift; us 1007 drivers/usb/storage/alauda.c unsigned int pageshift = MEDIA_INFO(us).pageshift; us 1008 drivers/usb/storage/alauda.c unsigned int blocksize = MEDIA_INFO(us).blocksize; us 1009 drivers/usb/storage/alauda.c unsigned int pagesize = MEDIA_INFO(us).pagesize; us 1037 drivers/usb/storage/alauda.c page = (address & MEDIA_INFO(us).blockmask); us 1038 drivers/usb/storage/alauda.c max_lba = MEDIA_INFO(us).capacity >> (pageshift + blockshift); us 1051 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Requested lba %u exceeds maximum %u\n", us 1058 drivers/usb/storage/alauda.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 1061 drivers/usb/storage/alauda.c result = alauda_write_lba(us, lba, page, pages, buffer, us 1100 drivers/usb/storage/alauda.c static int init_alauda(struct us_data *us) us 1103 drivers/usb/storage/alauda.c struct usb_host_interface *altsetting = us->pusb_intf->cur_altsetting; us 1106 drivers/usb/storage/alauda.c us->extra = kzalloc(sizeof(struct alauda_info), GFP_NOIO); us 1107 drivers/usb/storage/alauda.c if (!us->extra) us 1110 drivers/usb/storage/alauda.c info = (struct alauda_info *) us->extra; us 1111 drivers/usb/storage/alauda.c us->extra_destructor = alauda_info_destructor; us 1113 drivers/usb/storage/alauda.c info->wr_ep = usb_sndbulkpipe(us->pusb_dev, us 1120 drivers/usb/storage/alauda.c static int alauda_transport(struct scsi_cmnd *srb, struct us_data *us) us 1123 drivers/usb/storage/alauda.c struct alauda_info *info = (struct alauda_info *) us->extra; us 1124 drivers/usb/storage/alauda.c unsigned char *ptr = us->iobuf; us 1130 drivers/usb/storage/alauda.c usb_stor_dbg(us, "INQUIRY - Returning bogus response\n"); us 1132 drivers/usb/storage/alauda.c fill_inquiry_response(us, ptr, 36); us 1137 drivers/usb/storage/alauda.c usb_stor_dbg(us, "TEST_UNIT_READY\n"); us 1138 drivers/usb/storage/alauda.c return alauda_check_media(us); us 1145 drivers/usb/storage/alauda.c rc = alauda_check_media(us); us 1149 drivers/usb/storage/alauda.c num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift us 1150 drivers/usb/storage/alauda.c + MEDIA_INFO(us).blockshift + MEDIA_INFO(us).pageshift); us 1152 drivers/usb/storage/alauda.c capacity = num_zones * MEDIA_INFO(us).uzonesize us 1153 drivers/usb/storage/alauda.c * MEDIA_INFO(us).blocksize; us 1166 drivers/usb/storage/alauda.c rc = alauda_check_media(us); us 1175 drivers/usb/storage/alauda.c usb_stor_dbg(us, "READ_10: page %d pagect %d\n", page, pages); us 1177 drivers/usb/storage/alauda.c return alauda_read_data(us, page, pages); us 1183 drivers/usb/storage/alauda.c rc = alauda_check_media(us); us 1192 drivers/usb/storage/alauda.c usb_stor_dbg(us, "WRITE_10: page %d pagect %d\n", page, pages); us 1194 drivers/usb/storage/alauda.c return alauda_write_data(us, page, pages); us 1198 drivers/usb/storage/alauda.c usb_stor_dbg(us, "REQUEST_SENSE\n"); us 1219 drivers/usb/storage/alauda.c usb_stor_dbg(us, "Gah! Unknown command: %d (0x%x)\n", us 1232 drivers/usb/storage/alauda.c struct us_data *us; us 1235 drivers/usb/storage/alauda.c result = usb_stor_probe1(&us, intf, id, us 1241 drivers/usb/storage/alauda.c us->transport_name = "Alauda Control/Bulk"; us 1242 drivers/usb/storage/alauda.c us->transport = alauda_transport; us 1243 drivers/usb/storage/alauda.c us->transport_reset = usb_stor_Bulk_reset; us 1244 drivers/usb/storage/alauda.c us->max_lun = 1; us 1246 drivers/usb/storage/alauda.c result = usb_stor_probe2(us); us 73 drivers/usb/storage/cypress_atacb.c static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us) us 78 drivers/usb/storage/cypress_atacb.c usb_stor_transparent_scsi_command(srb, us); us 148 drivers/usb/storage/cypress_atacb.c usb_stor_transparent_scsi_command(srb, us); us 154 drivers/usb/storage/cypress_atacb.c usb_stor_dbg(us, "cypress atacb not supported ???\n"); us 183 drivers/usb/storage/cypress_atacb.c usb_stor_transparent_scsi_command(srb, us); us 244 drivers/usb/storage/cypress_atacb.c struct us_data *us; us 248 drivers/usb/storage/cypress_atacb.c result = usb_stor_probe1(&us, intf, id, us 262 drivers/usb/storage/cypress_atacb.c us->protocol_name = "Transparent SCSI with Cypress ATACB"; us 263 drivers/usb/storage/cypress_atacb.c us->proto_handler = cypress_atacb_passthrough; us 265 drivers/usb/storage/cypress_atacb.c us->protocol_name = "Transparent SCSI"; us 266 drivers/usb/storage/cypress_atacb.c us->proto_handler = usb_stor_transparent_scsi_command; us 269 drivers/usb/storage/cypress_atacb.c result = usb_stor_probe2(us); us 70 drivers/usb/storage/datafab.c static int datafab_determine_lun(struct us_data *us, us 114 drivers/usb/storage/datafab.c datafab_bulk_read(struct us_data *us, unsigned char *data, unsigned int len) { us 118 drivers/usb/storage/datafab.c usb_stor_dbg(us, "len = %d\n", len); us 119 drivers/usb/storage/datafab.c return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 125 drivers/usb/storage/datafab.c datafab_bulk_write(struct us_data *us, unsigned char *data, unsigned int len) { us 129 drivers/usb/storage/datafab.c usb_stor_dbg(us, "len = %d\n", len); us 130 drivers/usb/storage/datafab.c return usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 135 drivers/usb/storage/datafab.c static int datafab_read_data(struct us_data *us, us 140 drivers/usb/storage/datafab.c unsigned char *command = us->iobuf; us 157 drivers/usb/storage/datafab.c result = datafab_determine_lun(us, info); us 192 drivers/usb/storage/datafab.c result = datafab_bulk_write(us, command, 8); us 197 drivers/usb/storage/datafab.c result = datafab_bulk_read(us, buffer, len); us 202 drivers/usb/storage/datafab.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 218 drivers/usb/storage/datafab.c static int datafab_write_data(struct us_data *us, us 223 drivers/usb/storage/datafab.c unsigned char *command = us->iobuf; us 224 drivers/usb/storage/datafab.c unsigned char *reply = us->iobuf; us 241 drivers/usb/storage/datafab.c result = datafab_determine_lun(us, info); us 265 drivers/usb/storage/datafab.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 280 drivers/usb/storage/datafab.c result = datafab_bulk_write(us, command, 8); us 285 drivers/usb/storage/datafab.c result = datafab_bulk_write(us, buffer, len); us 290 drivers/usb/storage/datafab.c result = datafab_bulk_read(us, reply, 2); us 295 drivers/usb/storage/datafab.c usb_stor_dbg(us, "Gah! write return code: %02x %02x\n", us 314 drivers/usb/storage/datafab.c static int datafab_determine_lun(struct us_data *us, us 324 drivers/usb/storage/datafab.c unsigned char *command = us->iobuf; us 336 drivers/usb/storage/datafab.c usb_stor_dbg(us, "locating...\n"); us 343 drivers/usb/storage/datafab.c rc = datafab_bulk_write(us, command, 8); us 349 drivers/usb/storage/datafab.c rc = datafab_bulk_read(us, buf, 512); us 358 drivers/usb/storage/datafab.c rc = datafab_bulk_write(us, command, 8); us 364 drivers/usb/storage/datafab.c rc = datafab_bulk_read(us, buf, 512); us 381 drivers/usb/storage/datafab.c static int datafab_id_device(struct us_data *us, us 389 drivers/usb/storage/datafab.c unsigned char *command = us->iobuf; us 397 drivers/usb/storage/datafab.c rc = datafab_determine_lun(us, info); us 409 drivers/usb/storage/datafab.c rc = datafab_bulk_write(us, command, 8); us 417 drivers/usb/storage/datafab.c rc = datafab_bulk_read(us, reply, 512); us 437 drivers/usb/storage/datafab.c static int datafab_handle_mode_sense(struct us_data *us, us 455 drivers/usb/storage/datafab.c struct datafab_info *info = (struct datafab_info *) (us->extra); us 456 drivers/usb/storage/datafab.c unsigned char *ptr = us->iobuf; us 468 drivers/usb/storage/datafab.c usb_stor_dbg(us, "Current values\n"); us 471 drivers/usb/storage/datafab.c usb_stor_dbg(us, "Changeable values\n"); us 474 drivers/usb/storage/datafab.c usb_stor_dbg(us, "Default values\n"); us 477 drivers/usb/storage/datafab.c usb_stor_dbg(us, "Saves values\n"); us 548 drivers/usb/storage/datafab.c static int datafab_transport(struct scsi_cmnd *srb, struct us_data *us) us 553 drivers/usb/storage/datafab.c unsigned char *ptr = us->iobuf; us 558 drivers/usb/storage/datafab.c if (!us->extra) { us 559 drivers/usb/storage/datafab.c us->extra = kzalloc(sizeof(struct datafab_info), GFP_NOIO); us 560 drivers/usb/storage/datafab.c if (!us->extra) us 563 drivers/usb/storage/datafab.c us->extra_destructor = datafab_info_destructor; us 564 drivers/usb/storage/datafab.c ((struct datafab_info *)us->extra)->lun = -1; us 567 drivers/usb/storage/datafab.c info = (struct datafab_info *) (us->extra); us 570 drivers/usb/storage/datafab.c usb_stor_dbg(us, "INQUIRY - Returning bogus response\n"); us 572 drivers/usb/storage/datafab.c fill_inquiry_response(us, ptr, 36); us 578 drivers/usb/storage/datafab.c rc = datafab_id_device(us, info); us 582 drivers/usb/storage/datafab.c usb_stor_dbg(us, "READ_CAPACITY: %ld sectors, %ld bytes per sector\n", us 595 drivers/usb/storage/datafab.c usb_stor_dbg(us, "Gah! MODE_SELECT_10\n"); us 607 drivers/usb/storage/datafab.c usb_stor_dbg(us, "READ_10: read block 0x%04lx count %ld\n", us 609 drivers/usb/storage/datafab.c return datafab_read_data(us, info, block, blocks); us 621 drivers/usb/storage/datafab.c usb_stor_dbg(us, "READ_12: read block 0x%04lx count %ld\n", us 623 drivers/usb/storage/datafab.c return datafab_read_data(us, info, block, blocks); us 632 drivers/usb/storage/datafab.c usb_stor_dbg(us, "WRITE_10: write block 0x%04lx count %ld\n", us 634 drivers/usb/storage/datafab.c return datafab_write_data(us, info, block, blocks); us 646 drivers/usb/storage/datafab.c usb_stor_dbg(us, "WRITE_12: write block 0x%04lx count %ld\n", us 648 drivers/usb/storage/datafab.c return datafab_write_data(us, info, block, blocks); us 652 drivers/usb/storage/datafab.c usb_stor_dbg(us, "TEST_UNIT_READY\n"); us 653 drivers/usb/storage/datafab.c return datafab_id_device(us, info); us 657 drivers/usb/storage/datafab.c usb_stor_dbg(us, "REQUEST_SENSE - Returning faked response\n"); us 675 drivers/usb/storage/datafab.c usb_stor_dbg(us, "MODE_SENSE_6 detected\n"); us 676 drivers/usb/storage/datafab.c return datafab_handle_mode_sense(us, srb, 1); us 680 drivers/usb/storage/datafab.c usb_stor_dbg(us, "MODE_SENSE_10 detected\n"); us 681 drivers/usb/storage/datafab.c return datafab_handle_mode_sense(us, srb, 0); us 697 drivers/usb/storage/datafab.c usb_stor_dbg(us, "START_STOP\n"); us 702 drivers/usb/storage/datafab.c rc = datafab_id_device(us, info); us 713 drivers/usb/storage/datafab.c usb_stor_dbg(us, "Gah! Unknown command: %d (0x%x)\n", us 726 drivers/usb/storage/datafab.c struct us_data *us; us 729 drivers/usb/storage/datafab.c result = usb_stor_probe1(&us, intf, id, us 735 drivers/usb/storage/datafab.c us->transport_name = "Datafab Bulk-Only"; us 736 drivers/usb/storage/datafab.c us->transport = datafab_transport; us 737 drivers/usb/storage/datafab.c us->transport_reset = usb_stor_Bulk_reset; us 738 drivers/usb/storage/datafab.c us->max_lun = 1; us 740 drivers/usb/storage/datafab.c result = usb_stor_probe2(us); us 42 drivers/usb/storage/debug.c void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb) us 139 drivers/usb/storage/debug.c usb_stor_dbg(us, "Command %s (%d bytes)\n", what, srb->cmd_len); us 140 drivers/usb/storage/debug.c usb_stor_dbg(us, "bytes: %*ph\n", min_t(int, srb->cmd_len, 16), us 144 drivers/usb/storage/debug.c void usb_stor_show_sense(const struct us_data *us, us 160 drivers/usb/storage/debug.c usb_stor_dbg(us, "%s: %s (%s%x)\n", keystr, what, fmt, ascq); us 162 drivers/usb/storage/debug.c usb_stor_dbg(us, "%s: %s\n", keystr, what); us 165 drivers/usb/storage/debug.c void usb_stor_dbg(const struct us_data *us, const char *fmt, ...) us 171 drivers/usb/storage/debug.c dev_vprintk_emit(LOGLEVEL_DEBUG, &us->pusb_dev->dev, fmt, args); us 33 drivers/usb/storage/debug.h void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb); us 34 drivers/usb/storage/debug.h void usb_stor_show_sense(const struct us_data *us, unsigned char key, us 36 drivers/usb/storage/debug.h __printf(2, 3) void usb_stor_dbg(const struct us_data *us, us 42 drivers/usb/storage/debug.h static inline void _usb_stor_dbg(const struct us_data *us, us 46 drivers/usb/storage/debug.h #define usb_stor_dbg(us, fmt, ...) \ us 47 drivers/usb/storage/debug.h do { if (0) _usb_stor_dbg(us, fmt, ##__VA_ARGS__); } while (0) us 480 drivers/usb/storage/ene_ub6250.c static int ene_sd_init(struct us_data *us); us 481 drivers/usb/storage/ene_ub6250.c static int ene_ms_init(struct us_data *us); us 482 drivers/usb/storage/ene_ub6250.c static int ene_load_bincode(struct us_data *us, unsigned char flag); us 493 drivers/usb/storage/ene_ub6250.c static int ene_send_scsi_cmd(struct us_data *us, u8 fDir, void *buf, int use_sg) us 495 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 496 drivers/usb/storage/ene_ub6250.c struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) us->iobuf; us 505 drivers/usb/storage/ene_ub6250.c result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 508 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "send cmd to out endpoint fail ---\n"); us 516 drivers/usb/storage/ene_ub6250.c pipe = us->recv_bulk_pipe; us 518 drivers/usb/storage/ene_ub6250.c pipe = us->send_bulk_pipe; us 522 drivers/usb/storage/ene_ub6250.c result = usb_stor_bulk_srb(us, pipe, us->srb); us 524 drivers/usb/storage/ene_ub6250.c result = usb_stor_bulk_transfer_sg(us, pipe, buf, us 528 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "data transfer fail ---\n"); us 534 drivers/usb/storage/ene_ub6250.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, us 538 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Received 0-length CSW; retrying...\n"); us 539 drivers/usb/storage/ene_ub6250.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 545 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Attempting to get CSW (2nd try)...\n"); us 546 drivers/usb/storage/ene_ub6250.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 560 drivers/usb/storage/ene_ub6250.c if (residue && !(us->fflags & US_FL_IGNORE_RESIDUE)) { us 562 drivers/usb/storage/ene_ub6250.c if (us->srb != NULL) us 563 drivers/usb/storage/ene_ub6250.c scsi_set_resid(us->srb, max(scsi_get_resid(us->srb), us 573 drivers/usb/storage/ene_ub6250.c static int do_scsi_request_sense(struct us_data *us, struct scsi_cmnd *srb) us 575 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 589 drivers/usb/storage/ene_ub6250.c static int do_scsi_inquiry(struct us_data *us, struct scsi_cmnd *srb) us 601 drivers/usb/storage/ene_ub6250.c static int sd_scsi_test_unit_ready(struct us_data *us, struct scsi_cmnd *srb) us 603 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 608 drivers/usb/storage/ene_ub6250.c ene_sd_init(us); us 615 drivers/usb/storage/ene_ub6250.c static int sd_scsi_mode_sense(struct us_data *us, struct scsi_cmnd *srb) us 617 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 634 drivers/usb/storage/ene_ub6250.c static int sd_scsi_read_capacity(struct us_data *us, struct scsi_cmnd *srb) us 641 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 643 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "sd_scsi_read_capacity\n"); us 656 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "bl_len = %x\n", bl_len); us 657 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "bl_num = %x\n", bl_num); us 674 drivers/usb/storage/ene_ub6250.c static int sd_scsi_read(struct us_data *us, struct scsi_cmnd *srb) us 678 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 679 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 690 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, SD_RW_PATTERN); us 692 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Load SD RW pattern Fail !!\n"); us 710 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, scsi_sglist(srb), 1); us 714 drivers/usb/storage/ene_ub6250.c static int sd_scsi_write(struct us_data *us, struct scsi_cmnd *srb) us 718 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 719 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 730 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, SD_RW_PATTERN); us 732 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Load SD RW pattern Fail !!\n"); us 750 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_WRITE, scsi_sglist(srb), 1); us 758 drivers/usb/storage/ene_ub6250.c static int ms_lib_set_logicalpair(struct us_data *us, u16 logblk, u16 phyblk) us 760 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 771 drivers/usb/storage/ene_ub6250.c static int ms_lib_set_logicalblockmark(struct us_data *us, u16 phyblk, u16 mark) us 773 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 783 drivers/usb/storage/ene_ub6250.c static int ms_lib_set_initialerrorblock(struct us_data *us, u16 phyblk) us 785 drivers/usb/storage/ene_ub6250.c return ms_lib_set_logicalblockmark(us, phyblk, MS_LB_INITIAL_ERROR); us 788 drivers/usb/storage/ene_ub6250.c static int ms_lib_set_bootblockmark(struct us_data *us, u16 phyblk) us 790 drivers/usb/storage/ene_ub6250.c return ms_lib_set_logicalblockmark(us, phyblk, MS_LB_BOOT_BLOCK); us 793 drivers/usb/storage/ene_ub6250.c static int ms_lib_free_logicalmap(struct us_data *us) us 795 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 806 drivers/usb/storage/ene_ub6250.c static int ms_lib_alloc_logicalmap(struct us_data *us) us 809 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 819 drivers/usb/storage/ene_ub6250.c ms_lib_free_logicalmap(us); us 832 drivers/usb/storage/ene_ub6250.c static void ms_lib_clear_writebuf(struct us_data *us) us 835 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 853 drivers/usb/storage/ene_ub6250.c static int ms_count_freeblock(struct us_data *us, u16 PhyBlock) us 856 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 872 drivers/usb/storage/ene_ub6250.c static int ms_read_readpage(struct us_data *us, u32 PhyBlockAddr, us 875 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 876 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 881 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, MS_RW_PATTERN); us 899 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, PageBuf, 0); us 918 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, bbuf, 0); us 934 drivers/usb/storage/ene_ub6250.c static int ms_lib_process_bootblock(struct us_data *us, u16 PhyBlock, u8 *PageData) us 942 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 981 drivers/usb/storage/ene_ub6250.c if (ms_lib_alloc_logicalmap(us)) us 985 drivers/usb/storage/ene_ub6250.c ms_lib_set_bootblockmark(us, PhyBlock); us 1015 drivers/usb/storage/ene_ub6250.c switch (ms_read_readpage(us, PhyBlock, PageNumber, (u32 *)PageBuffer, &ExtraData)) { us 1030 drivers/usb/storage/ene_ub6250.c ms_lib_set_initialerrorblock(us, phyblk); us 1041 drivers/usb/storage/ene_ub6250.c switch (ms_read_readpage(us, PhyBlock, (u8)(EntryOffset / MS_BYTES_PER_PAGE + 1), (u32 *)PageBuffer, &ExtraData)) { us 1065 drivers/usb/storage/ene_ub6250.c ms_lib_free_logicalmap(us); us 1073 drivers/usb/storage/ene_ub6250.c static void ms_lib_free_writebuf(struct us_data *us) us 1075 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1094 drivers/usb/storage/ene_ub6250.c static void ms_lib_free_allocatedarea(struct us_data *us) us 1096 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1098 drivers/usb/storage/ene_ub6250.c ms_lib_free_writebuf(us); /* Free MS_Lib.pagemap */ us 1099 drivers/usb/storage/ene_ub6250.c ms_lib_free_logicalmap(us); /* kfree MS_Lib.Phy2LogMap and MS_Lib.Log2PhyMap */ us 1115 drivers/usb/storage/ene_ub6250.c static int ms_lib_alloc_writebuf(struct us_data *us) us 1117 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1129 drivers/usb/storage/ene_ub6250.c ms_lib_free_writebuf(us); us 1133 drivers/usb/storage/ene_ub6250.c ms_lib_clear_writebuf(us); us 1138 drivers/usb/storage/ene_ub6250.c static int ms_lib_force_setlogical_pair(struct us_data *us, u16 logblk, u16 phyblk) us 1140 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1155 drivers/usb/storage/ene_ub6250.c static int ms_read_copyblock(struct us_data *us, u16 oldphy, u16 newphy, us 1158 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 1161 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, MS_RW_PATTERN); us 1181 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_WRITE, buf, 0); us 1188 drivers/usb/storage/ene_ub6250.c static int ms_read_eraseblock(struct us_data *us, u32 PhyBlockAddr) us 1190 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 1194 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, MS_RW_PATTERN); us 1208 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, NULL, 0); us 1215 drivers/usb/storage/ene_ub6250.c static int ms_lib_check_disableblock(struct us_data *us, u16 PhyBlock) us 1221 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1229 drivers/usb/storage/ene_ub6250.c ms_read_readpage(us, PhyBlock, 1, (u32 *)PageBuf, &extdat); us 1246 drivers/usb/storage/ene_ub6250.c static int ms_lib_setacquired_errorblock(struct us_data *us, u16 phyblk) us 1249 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1265 drivers/usb/storage/ene_ub6250.c static int ms_lib_overwrite_extra(struct us_data *us, u32 PhyBlockAddr, us 1268 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 1271 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, MS_RW_PATTERN); us 1290 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, NULL, 0); us 1297 drivers/usb/storage/ene_ub6250.c static int ms_lib_error_phyblock(struct us_data *us, u16 phyblk) us 1299 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1304 drivers/usb/storage/ene_ub6250.c ms_lib_setacquired_errorblock(us, phyblk); us 1307 drivers/usb/storage/ene_ub6250.c return ms_lib_overwrite_extra(us, phyblk, 0, (u8)(~MS_REG_OVR_BKST & BYTE_MASK)); us 1312 drivers/usb/storage/ene_ub6250.c static int ms_lib_erase_phyblock(struct us_data *us, u16 phyblk) us 1315 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1328 drivers/usb/storage/ene_ub6250.c switch (ms_read_eraseblock(us, phyblk)) { us 1334 drivers/usb/storage/ene_ub6250.c ms_lib_error_phyblock(us, phyblk); us 1339 drivers/usb/storage/ene_ub6250.c ms_lib_setacquired_errorblock(us, phyblk); us 1344 drivers/usb/storage/ene_ub6250.c ms_lib_setacquired_errorblock(us, phyblk); us 1349 drivers/usb/storage/ene_ub6250.c static int ms_lib_read_extra(struct us_data *us, u32 PhyBlock, us 1352 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 1353 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1369 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, bbuf, 0); us 1384 drivers/usb/storage/ene_ub6250.c static int ms_libsearch_block_from_physical(struct us_data *us, u16 phyblk) us 1388 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1401 drivers/usb/storage/ene_ub6250.c switch (ms_lib_read_extra(us, blk, 0, &extdat)) { us 1411 drivers/usb/storage/ene_ub6250.c ms_lib_setacquired_errorblock(us, blk); us 1416 drivers/usb/storage/ene_ub6250.c ms_lib_setacquired_errorblock(us, blk); us 1420 drivers/usb/storage/ene_ub6250.c switch (ms_lib_erase_phyblock(us, blk)) { us 1427 drivers/usb/storage/ene_ub6250.c ms_lib_error_phyblock(us, blk); us 1435 drivers/usb/storage/ene_ub6250.c static int ms_libsearch_block_from_logical(struct us_data *us, u16 logblk) us 1438 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1450 drivers/usb/storage/ene_ub6250.c return ms_libsearch_block_from_physical(us, phyblk); us 1453 drivers/usb/storage/ene_ub6250.c static int ms_scsi_test_unit_ready(struct us_data *us, struct scsi_cmnd *srb) us 1455 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *)(us->extra); us 1461 drivers/usb/storage/ene_ub6250.c ene_ms_init(us); us 1468 drivers/usb/storage/ene_ub6250.c static int ms_scsi_mode_sense(struct us_data *us, struct scsi_cmnd *srb) us 1470 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1486 drivers/usb/storage/ene_ub6250.c static int ms_scsi_read_capacity(struct us_data *us, struct scsi_cmnd *srb) us 1493 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1495 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "ms_scsi_read_capacity\n"); us 1503 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "bl_len = %x\n", bl_len); us 1504 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "bl_num = %x\n", bl_num); us 1534 drivers/usb/storage/ene_ub6250.c static int ms_lib_read_extrablock(struct us_data *us, u32 PhyBlock, us 1537 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 1553 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, buf, 0); us 1560 drivers/usb/storage/ene_ub6250.c static int ms_lib_scan_logicalblocknumber(struct us_data *us, u16 btBlk1st) us 1566 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1581 drivers/usb/storage/ene_ub6250.c ms_lib_read_extrablock(us, PhyBlock, 0, 0x80, us 1593 drivers/usb/storage/ene_ub6250.c ms_lib_setacquired_errorblock(us, PhyBlock); us 1598 drivers/usb/storage/ene_ub6250.c ms_lib_erase_phyblock(us, PhyBlock); us 1604 drivers/usb/storage/ene_ub6250.c ms_lib_erase_phyblock(us, PhyBlock); us 1612 drivers/usb/storage/ene_ub6250.c ms_lib_set_logicalpair(us, extdat.logadr, PhyBlock); us 1613 drivers/usb/storage/ene_ub6250.c if (ms_lib_check_disableblock(us, btBlk1st)) { us 1614 drivers/usb/storage/ene_ub6250.c ms_lib_set_logicalpair(us, extdat.logadr, newblk); us 1619 drivers/usb/storage/ene_ub6250.c ms_lib_read_extra(us, newblk, 0, &extdat); us 1621 drivers/usb/storage/ene_ub6250.c ms_lib_erase_phyblock(us, PhyBlock); us 1624 drivers/usb/storage/ene_ub6250.c ms_lib_erase_phyblock(us, newblk); us 1628 drivers/usb/storage/ene_ub6250.c ms_lib_set_logicalpair(us, extdat.logadr, PhyBlock); us 1637 drivers/usb/storage/ene_ub6250.c static int ms_scsi_read(struct us_data *us, struct scsi_cmnd *srb) us 1641 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 1642 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1653 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, MSP_RW_PATTERN); us 1655 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Load MPS RW pattern Fail !!\n"); us 1671 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, scsi_sglist(srb), 1); us 1684 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, MS_RW_PATTERN); us 1715 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, buf+offset, 0); us 1736 drivers/usb/storage/ene_ub6250.c static int ms_scsi_write(struct us_data *us, struct scsi_cmnd *srb) us 1739 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 1741 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1754 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, MSP_RW_PATTERN); us 1772 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_WRITE, scsi_sglist(srb), 1); us 1785 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, MS_RW_PATTERN); us 1802 drivers/usb/storage/ene_ub6250.c newphy = ms_libsearch_block_from_logical(us, PhyBlockAddr); us 1804 drivers/usb/storage/ene_ub6250.c result = ms_read_copyblock(us, oldphy, newphy, PhyBlockAddr, PageNum, buf+offset, len); us 1813 drivers/usb/storage/ene_ub6250.c ms_lib_force_setlogical_pair(us, PhyBlockAddr, newphy); us 1832 drivers/usb/storage/ene_ub6250.c static int ene_get_card_type(struct us_data *us, u16 index, void *buf) us 1834 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 1845 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, buf, 0); us 1849 drivers/usb/storage/ene_ub6250.c static int ene_get_card_status(struct us_data *us, u8 *buf) us 1853 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1879 drivers/usb/storage/ene_ub6250.c static int ene_load_bincode(struct us_data *us, unsigned char flag) us 1886 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 1887 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1895 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "SD_INIT1_PATTERN\n"); us 1899 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "SD_INIT2_PATTERN\n"); us 1903 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "SD_RW_PATTERN\n"); us 1908 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "MS_INIT_PATTERN\n"); us 1912 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "MSP_RW_PATTERN\n"); us 1916 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "MS_RW_PATTERN\n"); us 1920 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "----------- Unknown PATTERN ----------\n"); us 1924 drivers/usb/storage/ene_ub6250.c err = request_firmware(&sd_fw, fw_name, &us->pusb_dev->dev); us 1926 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "load firmware %s failed\n", fw_name); us 1939 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_WRITE, buf, 0); us 1940 drivers/usb/storage/ene_ub6250.c if (us->srb != NULL) us 1941 drivers/usb/storage/ene_ub6250.c scsi_set_resid(us->srb, 0); us 1950 drivers/usb/storage/ene_ub6250.c static int ms_card_init(struct us_data *us) us 1958 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 1962 drivers/usb/storage/ene_ub6250.c ms_lib_free_allocatedarea(us); /* Clean buffer and set struct us_data flag to 0 */ us 1977 drivers/usb/storage/ene_ub6250.c switch (ms_read_readpage(us, TmpBlock, 0, (u32 *)PageBuffer0, &extdat)) { us 2019 drivers/usb/storage/ene_ub6250.c result = ms_lib_process_bootblock(us, btBlk1st, PageBuffer1); us 2023 drivers/usb/storage/ene_ub6250.c result = ms_lib_process_bootblock(us, btBlk2nd, PageBuffer0); us 2042 drivers/usb/storage/ene_ub6250.c result = ms_lib_scan_logicalblocknumber(us, btBlk1st); us 2049 drivers/usb/storage/ene_ub6250.c if (ms_count_freeblock(us, TmpBlock) == 0) { us 2056 drivers/usb/storage/ene_ub6250.c if (ms_lib_alloc_writebuf(us)) { us 2071 drivers/usb/storage/ene_ub6250.c static int ene_ms_init(struct us_data *us) us 2073 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 2076 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 2083 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, MS_INIT_PATTERN); us 2096 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, bbuf, 0); us 2115 drivers/usb/storage/ene_ub6250.c ms_card_init(us); /* Card is MS (to ms.c)*/ us 2117 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "MS Init Code OK !!\n"); us 2119 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "MS Card Not Ready --- %x\n", bbuf[0]); us 2126 drivers/usb/storage/ene_ub6250.c static int ene_sd_init(struct us_data *us) us 2129 drivers/usb/storage/ene_ub6250.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 2130 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; us 2133 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "transport --- ENE_SDInit\n"); us 2135 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, SD_INIT1_PATTERN); us 2137 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Load SD Init Code Part-1 Fail !!\n"); us 2146 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, NULL, 0); us 2148 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Execution SD Init Code Fail !!\n"); us 2153 drivers/usb/storage/ene_ub6250.c result = ene_load_bincode(us, SD_INIT2_PATTERN); us 2155 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Load SD Init Code Part-2 Fail !!\n"); us 2165 drivers/usb/storage/ene_ub6250.c result = ene_send_scsi_cmd(us, FDIR_READ, bbuf, 0); us 2167 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Execution SD Init Code Fail !!\n"); us 2175 drivers/usb/storage/ene_ub6250.c ene_get_card_status(us, bbuf); us 2176 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Insert = %x\n", s->Insert); us 2177 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "Ready = %x\n", s->Ready); us 2178 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "IsMMC = %x\n", s->IsMMC); us 2179 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "HiCapacity = %x\n", s->HiCapacity); us 2180 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "HiSpeed = %x\n", s->HiSpeed); us 2181 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "WtP = %x\n", s->WtP); us 2183 drivers/usb/storage/ene_ub6250.c usb_stor_dbg(us, "SD Card Not Ready --- %x\n", bbuf[0]); us 2190 drivers/usb/storage/ene_ub6250.c static int ene_init(struct us_data *us) us 2194 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *)(us->extra); us 2197 drivers/usb/storage/ene_ub6250.c result = ene_get_card_type(us, REG_CARD_STATUS, bbuf); us 2204 drivers/usb/storage/ene_ub6250.c result = ene_sd_init(us); us 2211 drivers/usb/storage/ene_ub6250.c result = ene_ms_init(us); us 2220 drivers/usb/storage/ene_ub6250.c static int sd_scsi_irp(struct us_data *us, struct scsi_cmnd *srb) us 2223 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *)us->extra; us 2227 drivers/usb/storage/ene_ub6250.c result = sd_scsi_test_unit_ready(us, srb); us 2230 drivers/usb/storage/ene_ub6250.c result = do_scsi_request_sense(us, srb); us 2233 drivers/usb/storage/ene_ub6250.c result = do_scsi_inquiry(us, srb); us 2236 drivers/usb/storage/ene_ub6250.c result = sd_scsi_mode_sense(us, srb); us 2244 drivers/usb/storage/ene_ub6250.c result = sd_scsi_read_capacity(us, srb); us 2247 drivers/usb/storage/ene_ub6250.c result = sd_scsi_read(us, srb); us 2250 drivers/usb/storage/ene_ub6250.c result = sd_scsi_write(us, srb); us 2265 drivers/usb/storage/ene_ub6250.c static int ms_scsi_irp(struct us_data *us, struct scsi_cmnd *srb) us 2268 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *)us->extra; us 2272 drivers/usb/storage/ene_ub6250.c result = ms_scsi_test_unit_ready(us, srb); us 2275 drivers/usb/storage/ene_ub6250.c result = do_scsi_request_sense(us, srb); us 2278 drivers/usb/storage/ene_ub6250.c result = do_scsi_inquiry(us, srb); us 2281 drivers/usb/storage/ene_ub6250.c result = ms_scsi_mode_sense(us, srb); us 2284 drivers/usb/storage/ene_ub6250.c result = ms_scsi_read_capacity(us, srb); us 2287 drivers/usb/storage/ene_ub6250.c result = ms_scsi_read(us, srb); us 2290 drivers/usb/storage/ene_ub6250.c result = ms_scsi_write(us, srb); us 2302 drivers/usb/storage/ene_ub6250.c static int ene_transport(struct scsi_cmnd *srb, struct us_data *us) us 2305 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *)(us->extra); us 2310 drivers/usb/storage/ene_ub6250.c result = ene_init(us); us 2314 drivers/usb/storage/ene_ub6250.c result = sd_scsi_irp(us, srb); us 2317 drivers/usb/storage/ene_ub6250.c result = ms_scsi_irp(us, srb); us 2329 drivers/usb/storage/ene_ub6250.c struct us_data *us; us 2332 drivers/usb/storage/ene_ub6250.c result = usb_stor_probe1(&us, intf, id, us 2339 drivers/usb/storage/ene_ub6250.c us->extra = kzalloc(sizeof(struct ene_ub6250_info), GFP_KERNEL); us 2340 drivers/usb/storage/ene_ub6250.c if (!us->extra) us 2342 drivers/usb/storage/ene_ub6250.c us->extra_destructor = ene_ub6250_info_destructor; us 2344 drivers/usb/storage/ene_ub6250.c info = (struct ene_ub6250_info *)(us->extra); us 2347 drivers/usb/storage/ene_ub6250.c kfree(us->extra); us 2351 drivers/usb/storage/ene_ub6250.c us->transport_name = "ene_ub6250"; us 2352 drivers/usb/storage/ene_ub6250.c us->transport = ene_transport; us 2353 drivers/usb/storage/ene_ub6250.c us->max_lun = 0; us 2355 drivers/usb/storage/ene_ub6250.c result = usb_stor_probe2(us); us 2360 drivers/usb/storage/ene_ub6250.c result = ene_get_card_type(us, REG_CARD_STATUS, info->bbuf); us 2381 drivers/usb/storage/ene_ub6250.c struct us_data *us = usb_get_intfdata(iface); us 2382 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *)(us->extra); us 2384 drivers/usb/storage/ene_ub6250.c mutex_lock(&us->dev_mutex); us 2386 drivers/usb/storage/ene_ub6250.c if (us->suspend_resume_hook) us 2387 drivers/usb/storage/ene_ub6250.c (us->suspend_resume_hook)(us, US_RESUME); us 2389 drivers/usb/storage/ene_ub6250.c mutex_unlock(&us->dev_mutex); us 2403 drivers/usb/storage/ene_ub6250.c struct us_data *us = usb_get_intfdata(iface); us 2404 drivers/usb/storage/ene_ub6250.c struct ene_ub6250_info *info = (struct ene_ub6250_info *)(us->extra); us 35 drivers/usb/storage/freecom.c static void pdump(struct us_data *us, void *ibuffer, int length); us 110 drivers/usb/storage/freecom.c static int init_freecom(struct us_data *us); us 152 drivers/usb/storage/freecom.c freecom_readdata (struct scsi_cmnd *srb, struct us_data *us, us 156 drivers/usb/storage/freecom.c (struct freecom_xfer_wrap *) us->iobuf; us 164 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Read data Freecom! (c=%d)\n", count); us 167 drivers/usb/storage/freecom.c result = usb_stor_bulk_transfer_buf (us, opipe, fxfr, us 170 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Freecom readdata transport error\n"); us 175 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Start of read\n"); us 176 drivers/usb/storage/freecom.c result = usb_stor_bulk_srb(us, ipipe, srb); us 177 drivers/usb/storage/freecom.c usb_stor_dbg(us, "freecom_readdata done!\n"); us 185 drivers/usb/storage/freecom.c freecom_writedata (struct scsi_cmnd *srb, struct us_data *us, us 189 drivers/usb/storage/freecom.c (struct freecom_xfer_wrap *) us->iobuf; us 197 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Write data Freecom! (c=%d)\n", count); us 200 drivers/usb/storage/freecom.c result = usb_stor_bulk_transfer_buf (us, opipe, fxfr, us 203 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Freecom writedata transport error\n"); us 208 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Start of write\n"); us 209 drivers/usb/storage/freecom.c result = usb_stor_bulk_srb(us, opipe, srb); us 211 drivers/usb/storage/freecom.c usb_stor_dbg(us, "freecom_writedata done!\n"); us 221 drivers/usb/storage/freecom.c static int freecom_transport(struct scsi_cmnd *srb, struct us_data *us) us 230 drivers/usb/storage/freecom.c fcb = (struct freecom_cb_wrap *) us->iobuf; us 231 drivers/usb/storage/freecom.c fst = (struct freecom_status *) us->iobuf; us 233 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Freecom TRANSPORT STARTED\n"); us 236 drivers/usb/storage/freecom.c opipe = us->send_bulk_pipe; us 237 drivers/usb/storage/freecom.c ipipe = us->recv_bulk_pipe; us 245 drivers/usb/storage/freecom.c US_DEBUG(pdump(us, srb->cmnd, 12)); us 248 drivers/usb/storage/freecom.c result = usb_stor_bulk_transfer_buf (us, opipe, fcb, us 257 drivers/usb/storage/freecom.c usb_stor_dbg(us, "freecom transport error\n"); us 265 drivers/usb/storage/freecom.c result = usb_stor_bulk_transfer_buf (us, ipipe, fst, us 267 drivers/usb/storage/freecom.c usb_stor_dbg(us, "foo Status result %d %u\n", result, partial); us 271 drivers/usb/storage/freecom.c US_DEBUG(pdump(us, (void *)fst, partial)); us 283 drivers/usb/storage/freecom.c usb_stor_dbg(us, "20 second USB/ATAPI bridge TIMEOUT occurred!\n"); us 284 drivers/usb/storage/freecom.c usb_stor_dbg(us, "fst->Status is %x\n", fst->Status); us 293 drivers/usb/storage/freecom.c result = usb_stor_bulk_transfer_buf (us, opipe, fcb, us 302 drivers/usb/storage/freecom.c usb_stor_dbg(us, "freecom transport error\n"); us 307 drivers/usb/storage/freecom.c result = usb_stor_bulk_transfer_buf (us, ipipe, fst, us 310 drivers/usb/storage/freecom.c usb_stor_dbg(us, "bar Status result %d %u\n", result, partial); us 314 drivers/usb/storage/freecom.c US_DEBUG(pdump(us, (void *)fst, partial)); us 320 drivers/usb/storage/freecom.c usb_stor_dbg(us, "operation failed\n"); us 329 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Device indicates that it has %d bytes available\n", us 331 drivers/usb/storage/freecom.c usb_stor_dbg(us, "SCSI requested %d\n", scsi_bufflen(srb)); us 348 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Truncating request to match buffer length: %d\n", us 357 drivers/usb/storage/freecom.c switch (us->srb->sc_data_direction) { us 367 drivers/usb/storage/freecom.c usb_stor_dbg(us, "SCSI wants data, drive doesn't have any\n"); us 370 drivers/usb/storage/freecom.c result = freecom_readdata (srb, us, ipipe, opipe, length); us 374 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Waiting for status\n"); us 375 drivers/usb/storage/freecom.c result = usb_stor_bulk_transfer_buf (us, ipipe, fst, us 377 drivers/usb/storage/freecom.c US_DEBUG(pdump(us, (void *)fst, partial)); us 382 drivers/usb/storage/freecom.c usb_stor_dbg(us, "operation failed\n"); us 386 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Drive seems still hungry\n"); us 389 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Transfer happy\n"); us 401 drivers/usb/storage/freecom.c result = freecom_writedata (srb, us, ipipe, opipe, length); us 405 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Waiting for status\n"); us 406 drivers/usb/storage/freecom.c result = usb_stor_bulk_transfer_buf (us, ipipe, fst, us 412 drivers/usb/storage/freecom.c usb_stor_dbg(us, "operation failed\n"); us 416 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Drive seems still hungry\n"); us 420 drivers/usb/storage/freecom.c usb_stor_dbg(us, "Transfer happy\n"); us 430 drivers/usb/storage/freecom.c usb_stor_dbg(us, "freecom unimplemented direction: %d\n", us 431 drivers/usb/storage/freecom.c us->srb->sc_data_direction); us 440 drivers/usb/storage/freecom.c static int init_freecom(struct us_data *us) us 443 drivers/usb/storage/freecom.c char *buffer = us->iobuf; us 450 drivers/usb/storage/freecom.c result = usb_stor_control_msg(us, us->recv_ctrl_pipe, us 453 drivers/usb/storage/freecom.c usb_stor_dbg(us, "String returned from FC init is: %s\n", buffer); us 463 drivers/usb/storage/freecom.c result = usb_stor_control_msg(us, us->send_ctrl_pipe, us 465 drivers/usb/storage/freecom.c usb_stor_dbg(us, "result from activate reset is %d\n", result); us 471 drivers/usb/storage/freecom.c result = usb_stor_control_msg(us, us->send_ctrl_pipe, us 473 drivers/usb/storage/freecom.c usb_stor_dbg(us, "result from clear reset is %d\n", result); us 481 drivers/usb/storage/freecom.c static int usb_stor_freecom_reset(struct us_data *us) us 490 drivers/usb/storage/freecom.c static void pdump(struct us_data *us, void *ibuffer, int length) us 510 drivers/usb/storage/freecom.c usb_stor_dbg(us, "%s\n", line); us 537 drivers/usb/storage/freecom.c usb_stor_dbg(us, "%s\n", line); us 547 drivers/usb/storage/freecom.c struct us_data *us; us 550 drivers/usb/storage/freecom.c result = usb_stor_probe1(&us, intf, id, us 556 drivers/usb/storage/freecom.c us->transport_name = "Freecom"; us 557 drivers/usb/storage/freecom.c us->transport = freecom_transport; us 558 drivers/usb/storage/freecom.c us->transport_reset = usb_stor_freecom_reset; us 559 drivers/usb/storage/freecom.c us->max_lun = 0; us 561 drivers/usb/storage/freecom.c result = usb_stor_probe2(us); us 34 drivers/usb/storage/initializers.c int usb_stor_euscsi_init(struct us_data *us) us 38 drivers/usb/storage/initializers.c usb_stor_dbg(us, "Attempting to init eUSCSI bridge...\n"); us 39 drivers/usb/storage/initializers.c result = usb_stor_control_msg(us, us->send_ctrl_pipe, us 42 drivers/usb/storage/initializers.c usb_stor_dbg(us, "-- result is %d\n", result); us 51 drivers/usb/storage/initializers.c int usb_stor_ucr61s2b_init(struct us_data *us) us 53 drivers/usb/storage/initializers.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap*) us->iobuf; us 54 drivers/usb/storage/initializers.c struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap*) us->iobuf; us 59 drivers/usb/storage/initializers.c usb_stor_dbg(us, "Sending UCR-61S2B initialization packet...\n"); us 69 drivers/usb/storage/initializers.c res = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb, us 74 drivers/usb/storage/initializers.c usb_stor_dbg(us, "Getting status packet...\n"); us 75 drivers/usb/storage/initializers.c res = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, us 84 drivers/usb/storage/initializers.c int usb_stor_huawei_e220_init(struct us_data *us) us 88 drivers/usb/storage/initializers.c result = usb_stor_control_msg(us, us->send_ctrl_pipe, us 92 drivers/usb/storage/initializers.c usb_stor_dbg(us, "Huawei mode set result is %d\n", result); us 30 drivers/usb/storage/initializers.h int usb_stor_euscsi_init(struct us_data *us); us 36 drivers/usb/storage/initializers.h int usb_stor_ucr61s2b_init(struct us_data *us); us 39 drivers/usb/storage/initializers.h int usb_stor_huawei_e220_init(struct us_data *us); us 58 drivers/usb/storage/isd200.c static int isd200_Initialization(struct us_data *us); us 399 drivers/usb/storage/isd200.c static void isd200_build_sense(struct us_data *us, struct scsi_cmnd *srb) us 401 drivers/usb/storage/isd200.c struct isd200_info *info = (struct isd200_info *)us->extra; us 477 drivers/usb/storage/isd200.c static int isd200_action( struct us_data *us, int action, us 483 drivers/usb/storage/isd200.c struct isd200_info *info = (struct isd200_info *)us->extra; us 497 drivers/usb/storage/isd200.c usb_stor_dbg(us, " isd200_action(READ_STATUS)\n"); us 506 drivers/usb/storage/isd200.c usb_stor_dbg(us, " isd200_action(ENUM,0x%02x)\n", value); us 516 drivers/usb/storage/isd200.c usb_stor_dbg(us, " isd200_action(RESET)\n"); us 525 drivers/usb/storage/isd200.c usb_stor_dbg(us, " isd200_action(REENABLE)\n"); us 534 drivers/usb/storage/isd200.c usb_stor_dbg(us, " isd200_action(SOFT_RESET)\n"); us 543 drivers/usb/storage/isd200.c usb_stor_dbg(us, " isd200_action(IDENTIFY)\n"); us 551 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Error: Undefined action %d\n", action); us 557 drivers/usb/storage/isd200.c status = usb_stor_Bulk_transport(srb, us); us 561 drivers/usb/storage/isd200.c usb_stor_dbg(us, " isd200_action(0x%02x) error: %d\n", us 578 drivers/usb/storage/isd200.c static int isd200_read_regs( struct us_data *us ) us 580 drivers/usb/storage/isd200.c struct isd200_info *info = (struct isd200_info *)us->extra; us 584 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Entering isd200_IssueATAReadRegs\n"); us 586 drivers/usb/storage/isd200.c transferStatus = isd200_action( us, ACTION_READ_STATUS, us 589 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Error reading ATA registers\n"); us 593 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Got ATA Register[ATA_REG_ERROR_OFFSET] = 0x%x\n", us 607 drivers/usb/storage/isd200.c static void isd200_invoke_transport( struct us_data *us, us 618 drivers/usb/storage/isd200.c transferStatus = usb_stor_Bulk_transport(srb, us); us 624 drivers/usb/storage/isd200.c if (test_bit(US_FLIDX_TIMED_OUT, &us->dflags)) { us 625 drivers/usb/storage/isd200.c usb_stor_dbg(us, "-- command was aborted\n"); us 637 drivers/usb/storage/isd200.c usb_stor_dbg(us, "-- transport indicates protocol failure\n"); us 642 drivers/usb/storage/isd200.c usb_stor_dbg(us, "-- transport indicates command failure\n"); us 647 drivers/usb/storage/isd200.c usb_stor_dbg(us, "-- transport indicates transport error\n"); us 653 drivers/usb/storage/isd200.c usb_stor_dbg(us, "-- transport indicates unknown error\n"); us 665 drivers/usb/storage/isd200.c usb_stor_dbg(us, "-- unexpectedly short transfer\n"); us 670 drivers/usb/storage/isd200.c result = isd200_read_regs(us); us 671 drivers/usb/storage/isd200.c if (test_bit(US_FLIDX_TIMED_OUT, &us->dflags)) { us 672 drivers/usb/storage/isd200.c usb_stor_dbg(us, "-- auto-sense aborted\n"); us 676 drivers/usb/storage/isd200.c isd200_build_sense(us, srb); us 704 drivers/usb/storage/isd200.c clear_bit(US_FLIDX_ABORTING, &us->dflags); us 709 drivers/usb/storage/isd200.c static void isd200_log_config(struct us_data *us, struct isd200_info *info) us 711 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Event Notification: 0x%x\n", us 713 drivers/usb/storage/isd200.c usb_stor_dbg(us, " External Clock: 0x%x\n", us 715 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA Init Timeout: 0x%x\n", us 717 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATAPI Command Block Size: 0x%x\n", us 719 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Master/Slave Selection: 0x%x\n", us 721 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATAPI Reset: 0x%x\n", us 723 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA Timing: 0x%x\n", us 725 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA Major Command: 0x%x\n", us 727 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA Minor Command: 0x%x\n", us 729 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Init Status: 0x%x\n", us 731 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Config Descriptor 2: 0x%x\n", us 733 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Skip Device Boot: 0x%x\n", us 735 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA 3 State Suspend: 0x%x\n", us 737 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Descriptor Override: 0x%x\n", us 739 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Last LUN Identifier: 0x%x\n", us 741 drivers/usb/storage/isd200.c usb_stor_dbg(us, " SRST Enable: 0x%x\n", us 754 drivers/usb/storage/isd200.c static int isd200_write_config( struct us_data *us ) us 756 drivers/usb/storage/isd200.c struct isd200_info *info = (struct isd200_info *)us->extra; us 761 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Entering isd200_write_config\n"); us 762 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Writing the following ISD200 Config Data:\n"); us 763 drivers/usb/storage/isd200.c isd200_log_config(us, info); us 768 drivers/usb/storage/isd200.c us, us 769 drivers/usb/storage/isd200.c us->send_ctrl_pipe, us 778 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ISD200 Config Data was written successfully\n"); us 780 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Request to write ISD200 Config Data failed!\n"); us 784 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Leaving isd200_write_config %08X\n", retStatus); us 797 drivers/usb/storage/isd200.c static int isd200_read_config( struct us_data *us ) us 799 drivers/usb/storage/isd200.c struct isd200_info *info = (struct isd200_info *)us->extra; us 803 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Entering isd200_read_config\n"); us 809 drivers/usb/storage/isd200.c us, us 810 drivers/usb/storage/isd200.c us->recv_ctrl_pipe, us 820 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Retrieved the following ISD200 Config Data:\n"); us 822 drivers/usb/storage/isd200.c isd200_log_config(us, info); us 825 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Request to get ISD200 Config Data failed!\n"); us 829 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Leaving isd200_read_config %08X\n", retStatus); us 842 drivers/usb/storage/isd200.c static int isd200_atapi_soft_reset( struct us_data *us ) us 847 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Entering isd200_atapi_soft_reset\n"); us 849 drivers/usb/storage/isd200.c transferStatus = isd200_action( us, ACTION_SOFT_RESET, NULL, 0 ); us 851 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Error issuing Atapi Soft Reset\n"); us 855 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Leaving isd200_atapi_soft_reset %08X\n", retStatus); us 868 drivers/usb/storage/isd200.c static int isd200_srst( struct us_data *us ) us 873 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Entering isd200_SRST\n"); us 875 drivers/usb/storage/isd200.c transferStatus = isd200_action( us, ACTION_RESET, NULL, 0 ); us 879 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Error issuing SRST\n"); us 885 drivers/usb/storage/isd200.c transferStatus = isd200_action( us, ACTION_REENABLE, NULL, 0 ); us 887 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Error taking drive out of reset\n"); us 895 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Leaving isd200_srst %08X\n", retStatus); us 909 drivers/usb/storage/isd200.c static int isd200_try_enum(struct us_data *us, unsigned char master_slave, us 914 drivers/usb/storage/isd200.c struct isd200_info *info = (struct isd200_info *)us->extra; us 926 drivers/usb/storage/isd200.c status = isd200_action( us, ACTION_ENUM, NULL, master_slave ); us 930 drivers/usb/storage/isd200.c status = isd200_action( us, ACTION_READ_STATUS, us 937 drivers/usb/storage/isd200.c usb_stor_dbg(us, " %s status is still BSY, try again...\n", us 941 drivers/usb/storage/isd200.c usb_stor_dbg(us, " %s status !BSY, continue with next operation\n", us 952 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Status indicates it is not ready, try again...\n"); us 956 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Identified ATA device\n"); us 979 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Identified ATAPI device as slave. Rechecking again as master\n"); us 983 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Identified ATAPI device\n"); us 986 drivers/usb/storage/isd200.c status = isd200_atapi_soft_reset(us); us 990 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Not ATA, not ATAPI - Weird\n"); us 997 drivers/usb/storage/isd200.c usb_stor_dbg(us, " BSY check timeout, just continue with next operation...\n"); us 999 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Device detect timeout!\n"); us 1016 drivers/usb/storage/isd200.c static int isd200_manual_enum(struct us_data *us) us 1018 drivers/usb/storage/isd200.c struct isd200_info *info = (struct isd200_info *)us->extra; us 1021 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Entering isd200_manual_enum\n"); us 1023 drivers/usb/storage/isd200.c retStatus = isd200_read_config(us); us 1027 drivers/usb/storage/isd200.c retStatus = isd200_try_enum( us, ATA_ADDRESS_DEVHEAD_STD, 0); us 1029 drivers/usb/storage/isd200.c retStatus = isd200_try_enum( us, ATA_ADDRESS_DEVHEAD_SLAVE, 0); us 1032 drivers/usb/storage/isd200.c retStatus = isd200_srst(us); us 1035 drivers/usb/storage/isd200.c retStatus = isd200_try_enum( us, ATA_ADDRESS_DEVHEAD_STD, 1); us 1040 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Setting Master/Slave selection to %d\n", us 1044 drivers/usb/storage/isd200.c retStatus = isd200_write_config(us); us 1048 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Leaving isd200_manual_enum %08X\n", retStatus); us 1066 drivers/usb/storage/isd200.c static void isd200_dump_driveid(struct us_data *us, u16 *id) us 1068 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Identify Data Structure:\n"); us 1069 drivers/usb/storage/isd200.c usb_stor_dbg(us, " config = 0x%x\n", id[ATA_ID_CONFIG]); us 1070 drivers/usb/storage/isd200.c usb_stor_dbg(us, " cyls = 0x%x\n", id[ATA_ID_CYLS]); us 1071 drivers/usb/storage/isd200.c usb_stor_dbg(us, " heads = 0x%x\n", id[ATA_ID_HEADS]); us 1072 drivers/usb/storage/isd200.c usb_stor_dbg(us, " track_bytes = 0x%x\n", id[4]); us 1073 drivers/usb/storage/isd200.c usb_stor_dbg(us, " sector_bytes = 0x%x\n", id[5]); us 1074 drivers/usb/storage/isd200.c usb_stor_dbg(us, " sectors = 0x%x\n", id[ATA_ID_SECTORS]); us 1075 drivers/usb/storage/isd200.c usb_stor_dbg(us, " serial_no[0] = 0x%x\n", *(char *)&id[ATA_ID_SERNO]); us 1076 drivers/usb/storage/isd200.c usb_stor_dbg(us, " buf_type = 0x%x\n", id[20]); us 1077 drivers/usb/storage/isd200.c usb_stor_dbg(us, " buf_size = 0x%x\n", id[ATA_ID_BUF_SIZE]); us 1078 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ecc_bytes = 0x%x\n", id[22]); us 1079 drivers/usb/storage/isd200.c usb_stor_dbg(us, " fw_rev[0] = 0x%x\n", *(char *)&id[ATA_ID_FW_REV]); us 1080 drivers/usb/storage/isd200.c usb_stor_dbg(us, " model[0] = 0x%x\n", *(char *)&id[ATA_ID_PROD]); us 1081 drivers/usb/storage/isd200.c usb_stor_dbg(us, " max_multsect = 0x%x\n", id[ATA_ID_MAX_MULTSECT] & 0xff); us 1082 drivers/usb/storage/isd200.c usb_stor_dbg(us, " dword_io = 0x%x\n", id[ATA_ID_DWORD_IO]); us 1083 drivers/usb/storage/isd200.c usb_stor_dbg(us, " capability = 0x%x\n", id[ATA_ID_CAPABILITY] >> 8); us 1084 drivers/usb/storage/isd200.c usb_stor_dbg(us, " tPIO = 0x%x\n", id[ATA_ID_OLD_PIO_MODES] >> 8); us 1085 drivers/usb/storage/isd200.c usb_stor_dbg(us, " tDMA = 0x%x\n", id[ATA_ID_OLD_DMA_MODES] >> 8); us 1086 drivers/usb/storage/isd200.c usb_stor_dbg(us, " field_valid = 0x%x\n", id[ATA_ID_FIELD_VALID]); us 1087 drivers/usb/storage/isd200.c usb_stor_dbg(us, " cur_cyls = 0x%x\n", id[ATA_ID_CUR_CYLS]); us 1088 drivers/usb/storage/isd200.c usb_stor_dbg(us, " cur_heads = 0x%x\n", id[ATA_ID_CUR_HEADS]); us 1089 drivers/usb/storage/isd200.c usb_stor_dbg(us, " cur_sectors = 0x%x\n", id[ATA_ID_CUR_SECTORS]); us 1090 drivers/usb/storage/isd200.c usb_stor_dbg(us, " cur_capacity = 0x%x\n", ata_id_u32(id, 57)); us 1091 drivers/usb/storage/isd200.c usb_stor_dbg(us, " multsect = 0x%x\n", id[ATA_ID_MULTSECT] & 0xff); us 1092 drivers/usb/storage/isd200.c usb_stor_dbg(us, " lba_capacity = 0x%x\n", ata_id_u32(id, ATA_ID_LBA_CAPACITY)); us 1093 drivers/usb/storage/isd200.c usb_stor_dbg(us, " command_set_1 = 0x%x\n", id[ATA_ID_COMMAND_SET_1]); us 1094 drivers/usb/storage/isd200.c usb_stor_dbg(us, " command_set_2 = 0x%x\n", id[ATA_ID_COMMAND_SET_2]); us 1105 drivers/usb/storage/isd200.c static int isd200_get_inquiry_data( struct us_data *us ) us 1107 drivers/usb/storage/isd200.c struct isd200_info *info = (struct isd200_info *)us->extra; us 1111 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Entering isd200_get_inquiry_data\n"); us 1117 drivers/usb/storage/isd200.c retStatus = isd200_manual_enum(us); us 1125 drivers/usb/storage/isd200.c transferStatus = isd200_action( us, ACTION_IDENTIFY, us 1129 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Error issuing ATA Command Identify\n"); us 1138 drivers/usb/storage/isd200.c isd200_dump_driveid(us, id); us 1172 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Device supports Media Status Notification\n"); us 1191 drivers/usb/storage/isd200.c us->protocol_name = "Transparent SCSI"; us 1192 drivers/usb/storage/isd200.c us->proto_handler = usb_stor_transparent_scsi_command; us 1194 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Protocol changed to: %s\n", us 1195 drivers/usb/storage/isd200.c us->protocol_name); us 1198 drivers/usb/storage/isd200.c us->extra_destructor(info); us 1200 drivers/usb/storage/isd200.c us->extra = NULL; us 1201 drivers/usb/storage/isd200.c us->extra_destructor = NULL; us 1205 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Leaving isd200_get_inquiry_data %08X\n", retStatus); us 1219 drivers/usb/storage/isd200.c static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, us 1222 drivers/usb/storage/isd200.c struct isd200_info *info = (struct isd200_info *)us->extra; us 1236 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA OUT - INQUIRY\n"); us 1246 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA OUT - SCSIOP_MODE_SENSE\n"); us 1260 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Media Status not supported, just report okay\n"); us 1267 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA OUT - SCSIOP_TEST_UNIT_READY\n"); us 1278 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Media Status not supported, just report okay\n"); us 1289 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA OUT - SCSIOP_READ_CAPACITY\n"); us 1308 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA OUT - SCSIOP_READ\n"); us 1340 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA OUT - SCSIOP_WRITE\n"); us 1372 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA OUT - SCSIOP_MEDIUM_REMOVAL\n"); us 1375 drivers/usb/storage/isd200.c usb_stor_dbg(us, " srb->cmnd[4] = 0x%X\n", us 1386 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Not removeable media, just report okay\n"); us 1393 drivers/usb/storage/isd200.c usb_stor_dbg(us, " ATA OUT - SCSIOP_START_STOP_UNIT\n"); us 1394 drivers/usb/storage/isd200.c usb_stor_dbg(us, " srb->cmnd[4] = 0x%X\n", srb->cmnd[4]); us 1397 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Media Eject\n"); us 1404 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Get Media Status\n"); us 1412 drivers/usb/storage/isd200.c usb_stor_dbg(us, " Nothing to do, just report okay\n"); us 1419 drivers/usb/storage/isd200.c usb_stor_dbg(us, "Unsupported SCSI command - 0x%X\n", us 1454 drivers/usb/storage/isd200.c static int isd200_init_info(struct us_data *us) us 1472 drivers/usb/storage/isd200.c us->extra = info; us 1473 drivers/usb/storage/isd200.c us->extra_destructor = isd200_free_info_ptrs; us 1482 drivers/usb/storage/isd200.c static int isd200_Initialization(struct us_data *us) us 1484 drivers/usb/storage/isd200.c usb_stor_dbg(us, "ISD200 Initialization...\n"); us 1488 drivers/usb/storage/isd200.c if (isd200_init_info(us) == ISD200_ERROR) { us 1489 drivers/usb/storage/isd200.c usb_stor_dbg(us, "ERROR Initializing ISD200 Info struct\n"); us 1493 drivers/usb/storage/isd200.c if (isd200_get_inquiry_data(us) != ISD200_GOOD) us 1494 drivers/usb/storage/isd200.c usb_stor_dbg(us, "ISD200 Initialization Failure\n"); us 1496 drivers/usb/storage/isd200.c usb_stor_dbg(us, "ISD200 Initialization complete\n"); us 1513 drivers/usb/storage/isd200.c static void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us) us 1520 drivers/usb/storage/isd200.c if (us->extra == NULL) { us 1521 drivers/usb/storage/isd200.c usb_stor_dbg(us, "ERROR Driver not initialized\n"); us 1529 drivers/usb/storage/isd200.c sendToTransport = isd200_scsi_to_ata(srb, us, &ataCdb); us 1533 drivers/usb/storage/isd200.c isd200_invoke_transport(us, srb, &ataCdb); us 1543 drivers/usb/storage/isd200.c struct us_data *us; us 1546 drivers/usb/storage/isd200.c result = usb_stor_probe1(&us, intf, id, us 1552 drivers/usb/storage/isd200.c us->protocol_name = "ISD200 ATA/ATAPI"; us 1553 drivers/usb/storage/isd200.c us->proto_handler = isd200_ata_command; us 1555 drivers/usb/storage/isd200.c result = usb_stor_probe2(us); us 105 drivers/usb/storage/jumpshot.c static inline int jumpshot_bulk_read(struct us_data *us, us 112 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "len = %d\n", len); us 113 drivers/usb/storage/jumpshot.c return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 118 drivers/usb/storage/jumpshot.c static inline int jumpshot_bulk_write(struct us_data *us, us 125 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "len = %d\n", len); us 126 drivers/usb/storage/jumpshot.c return usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 131 drivers/usb/storage/jumpshot.c static int jumpshot_get_status(struct us_data *us) us 135 drivers/usb/storage/jumpshot.c if (!us) us 139 drivers/usb/storage/jumpshot.c rc = usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, us 140 drivers/usb/storage/jumpshot.c 0, 0xA0, 0, 7, us->iobuf, 1); us 145 drivers/usb/storage/jumpshot.c if (us->iobuf[0] != 0x50) { us 146 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "0x%2x\n", us->iobuf[0]); us 153 drivers/usb/storage/jumpshot.c static int jumpshot_read_data(struct us_data *us, us 158 drivers/usb/storage/jumpshot.c unsigned char *command = us->iobuf; us 201 drivers/usb/storage/jumpshot.c result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, us 207 drivers/usb/storage/jumpshot.c result = jumpshot_bulk_read(us, buffer, len); us 211 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "%d bytes\n", len); us 214 drivers/usb/storage/jumpshot.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 230 drivers/usb/storage/jumpshot.c static int jumpshot_write_data(struct us_data *us, us 235 drivers/usb/storage/jumpshot.c unsigned char *command = us->iobuf; us 270 drivers/usb/storage/jumpshot.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 283 drivers/usb/storage/jumpshot.c result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, us 289 drivers/usb/storage/jumpshot.c result = jumpshot_bulk_write(us, buffer, len); us 298 drivers/usb/storage/jumpshot.c result = jumpshot_get_status(us); us 307 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "Gah! Waitcount = 10. Bad write!?\n"); us 321 drivers/usb/storage/jumpshot.c static int jumpshot_id_device(struct us_data *us, us 324 drivers/usb/storage/jumpshot.c unsigned char *command = us->iobuf; us 338 drivers/usb/storage/jumpshot.c rc = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, us 342 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "Gah! send_control for read_capacity failed\n"); us 348 drivers/usb/storage/jumpshot.c rc = jumpshot_bulk_read(us, reply, 512); us 366 drivers/usb/storage/jumpshot.c static int jumpshot_handle_mode_sense(struct us_data *us, us 384 drivers/usb/storage/jumpshot.c struct jumpshot_info *info = (struct jumpshot_info *) (us->extra); us 385 drivers/usb/storage/jumpshot.c unsigned char *ptr = us->iobuf; us 392 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "Current values\n"); us 395 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "Changeable values\n"); us 398 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "Default values\n"); us 401 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "Saves values\n"); us 474 drivers/usb/storage/jumpshot.c static int jumpshot_transport(struct scsi_cmnd *srb, struct us_data *us) us 479 drivers/usb/storage/jumpshot.c unsigned char *ptr = us->iobuf; us 484 drivers/usb/storage/jumpshot.c if (!us->extra) { us 485 drivers/usb/storage/jumpshot.c us->extra = kzalloc(sizeof(struct jumpshot_info), GFP_NOIO); us 486 drivers/usb/storage/jumpshot.c if (!us->extra) us 489 drivers/usb/storage/jumpshot.c us->extra_destructor = jumpshot_info_destructor; us 492 drivers/usb/storage/jumpshot.c info = (struct jumpshot_info *) (us->extra); us 495 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "INQUIRY - Returning bogus response\n"); us 497 drivers/usb/storage/jumpshot.c fill_inquiry_response(us, ptr, 36); us 504 drivers/usb/storage/jumpshot.c rc = jumpshot_get_status(us); us 508 drivers/usb/storage/jumpshot.c rc = jumpshot_id_device(us, info); us 512 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "READ_CAPACITY: %ld sectors, %ld bytes per sector\n", us 525 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "Gah! MODE_SELECT_10\n"); us 535 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "READ_10: read block 0x%04lx count %ld\n", us 537 drivers/usb/storage/jumpshot.c return jumpshot_read_data(us, info, block, blocks); us 549 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "READ_12: read block 0x%04lx count %ld\n", us 551 drivers/usb/storage/jumpshot.c return jumpshot_read_data(us, info, block, blocks); us 560 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "WRITE_10: write block 0x%04lx count %ld\n", us 562 drivers/usb/storage/jumpshot.c return jumpshot_write_data(us, info, block, blocks); us 574 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "WRITE_12: write block 0x%04lx count %ld\n", us 576 drivers/usb/storage/jumpshot.c return jumpshot_write_data(us, info, block, blocks); us 581 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "TEST_UNIT_READY\n"); us 582 drivers/usb/storage/jumpshot.c return jumpshot_get_status(us); us 586 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "REQUEST_SENSE\n"); us 600 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "MODE_SENSE_6 detected\n"); us 601 drivers/usb/storage/jumpshot.c return jumpshot_handle_mode_sense(us, srb, 1); us 605 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "MODE_SENSE_10 detected\n"); us 606 drivers/usb/storage/jumpshot.c return jumpshot_handle_mode_sense(us, srb, 0); us 622 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "START_STOP\n"); us 627 drivers/usb/storage/jumpshot.c rc = jumpshot_id_device(us, info); us 638 drivers/usb/storage/jumpshot.c usb_stor_dbg(us, "Gah! Unknown command: %d (0x%x)\n", us 651 drivers/usb/storage/jumpshot.c struct us_data *us; us 654 drivers/usb/storage/jumpshot.c result = usb_stor_probe1(&us, intf, id, us 660 drivers/usb/storage/jumpshot.c us->transport_name = "Lexar Jumpshot Control/Bulk"; us 661 drivers/usb/storage/jumpshot.c us->transport = jumpshot_transport; us 662 drivers/usb/storage/jumpshot.c us->transport_reset = usb_stor_Bulk_reset; us 663 drivers/usb/storage/jumpshot.c us->max_lun = 1; us 665 drivers/usb/storage/jumpshot.c result = usb_stor_probe2(us); us 42 drivers/usb/storage/karma.c static int rio_karma_init(struct us_data *us); us 94 drivers/usb/storage/karma.c static int rio_karma_send_command(char cmd, struct us_data *us) us 99 drivers/usb/storage/karma.c struct karma_data *data = (struct karma_data *) us->extra; us 101 drivers/usb/storage/karma.c usb_stor_dbg(us, "sending command %04x\n", cmd); us 102 drivers/usb/storage/karma.c memset(us->iobuf, 0, RIO_SEND_LEN); us 103 drivers/usb/storage/karma.c memcpy(us->iobuf, RIO_PREFIX, RIO_PREFIX_LEN); us 104 drivers/usb/storage/karma.c us->iobuf[5] = cmd; us 105 drivers/usb/storage/karma.c us->iobuf[6] = seq; us 109 drivers/usb/storage/karma.c result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 110 drivers/usb/storage/karma.c us->iobuf, RIO_SEND_LEN, NULL); us 114 drivers/usb/storage/karma.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 125 drivers/usb/storage/karma.c us->iobuf[4] = 0x80; us 126 drivers/usb/storage/karma.c us->iobuf[5] = 0; us 134 drivers/usb/storage/karma.c usb_stor_dbg(us, "sent command %04x\n", cmd); us 137 drivers/usb/storage/karma.c usb_stor_dbg(us, "command %04x failed\n", cmd); us 145 drivers/usb/storage/karma.c static int rio_karma_transport(struct scsi_cmnd *srb, struct us_data *us) us 148 drivers/usb/storage/karma.c struct karma_data *data = (struct karma_data *) us->extra; us 151 drivers/usb/storage/karma.c ret = rio_karma_send_command(RIO_ENTER_STORAGE, us); us 156 drivers/usb/storage/karma.c return usb_stor_Bulk_transport(srb, us); us 158 drivers/usb/storage/karma.c ret = rio_karma_send_command(RIO_LEAVE_STORAGE, us); us 163 drivers/usb/storage/karma.c return rio_karma_send_command(RIO_RESET, us); us 165 drivers/usb/storage/karma.c return usb_stor_Bulk_transport(srb, us); us 175 drivers/usb/storage/karma.c static int rio_karma_init(struct us_data *us) us 189 drivers/usb/storage/karma.c us->extra = data; us 190 drivers/usb/storage/karma.c us->extra_destructor = rio_karma_destructor; us 191 drivers/usb/storage/karma.c ret = rio_karma_send_command(RIO_ENTER_STORAGE, us); us 202 drivers/usb/storage/karma.c struct us_data *us; us 205 drivers/usb/storage/karma.c result = usb_stor_probe1(&us, intf, id, us 211 drivers/usb/storage/karma.c us->transport_name = "Rio Karma/Bulk"; us 212 drivers/usb/storage/karma.c us->transport = rio_karma_transport; us 213 drivers/usb/storage/karma.c us->transport_reset = usb_stor_Bulk_reset; us 215 drivers/usb/storage/karma.c result = usb_stor_probe2(us); us 142 drivers/usb/storage/onetouch.c static void usb_onetouch_pm_hook(struct us_data *us, int action) us 144 drivers/usb/storage/onetouch.c struct usb_onetouch *onetouch = (struct usb_onetouch *) us->extra; us 278 drivers/usb/storage/onetouch.c struct us_data *us; us 281 drivers/usb/storage/onetouch.c result = usb_stor_probe1(&us, intf, id, us 289 drivers/usb/storage/onetouch.c result = usb_stor_probe2(us); us 29 drivers/usb/storage/option_ms.c static int option_rezero(struct us_data *us) us 40 drivers/usb/storage/option_ms.c usb_stor_dbg(us, "Option MS: %s\n", "DEVICE MODE SWITCH"); us 47 drivers/usb/storage/option_ms.c result = usb_stor_bulk_transfer_buf(us, us 48 drivers/usb/storage/option_ms.c us->send_bulk_pipe, us 59 drivers/usb/storage/option_ms.c usb_stor_bulk_transfer_buf(us, us 60 drivers/usb/storage/option_ms.c us->recv_bulk_pipe, us 64 drivers/usb/storage/option_ms.c usb_stor_bulk_transfer_buf(us, us 65 drivers/usb/storage/option_ms.c us->recv_bulk_pipe, us 75 drivers/usb/storage/option_ms.c static int option_inquiry(struct us_data *us) us 86 drivers/usb/storage/option_ms.c usb_stor_dbg(us, "Option MS: %s\n", "device inquiry for vendor name"); us 93 drivers/usb/storage/option_ms.c result = usb_stor_bulk_transfer_buf(us, us 94 drivers/usb/storage/option_ms.c us->send_bulk_pipe, us 101 drivers/usb/storage/option_ms.c result = usb_stor_bulk_transfer_buf(us, us 102 drivers/usb/storage/option_ms.c us->recv_bulk_pipe, us 115 drivers/usb/storage/option_ms.c usb_stor_bulk_transfer_buf(us, us 116 drivers/usb/storage/option_ms.c us->recv_bulk_pipe, us 125 drivers/usb/storage/option_ms.c int option_ms_init(struct us_data *us) us 129 drivers/usb/storage/option_ms.c usb_stor_dbg(us, "Option MS: %s\n", "option_ms_init called"); us 135 drivers/usb/storage/option_ms.c result = option_inquiry(us); us 137 drivers/usb/storage/option_ms.c usb_stor_dbg(us, "Option MS: %s\n", us 141 drivers/usb/storage/option_ms.c usb_stor_dbg(us, "Option MS: %s\n", us 146 drivers/usb/storage/option_ms.c usb_stor_dbg(us, "Option MS: %s\n", "Forcing Modem Mode"); us 147 drivers/usb/storage/option_ms.c result = option_rezero(us); us 149 drivers/usb/storage/option_ms.c usb_stor_dbg(us, "Option MS: %s\n", us 154 drivers/usb/storage/option_ms.c usb_stor_dbg(us, "Option MS: %s\n", us 4 drivers/usb/storage/option_ms.h extern int option_ms_init(struct us_data *us); us 45 drivers/usb/storage/protocol.c void usb_stor_pad12_command(struct scsi_cmnd *srb, struct us_data *us) us 58 drivers/usb/storage/protocol.c usb_stor_invoke_transport(srb, us); us 61 drivers/usb/storage/protocol.c void usb_stor_ufi_command(struct scsi_cmnd *srb, struct us_data *us) us 101 drivers/usb/storage/protocol.c usb_stor_invoke_transport(srb, us); us 105 drivers/usb/storage/protocol.c struct us_data *us) us 108 drivers/usb/storage/protocol.c usb_stor_invoke_transport(srb, us); us 100 drivers/usb/storage/realtek_cr.c struct us_data *us; us 158 drivers/usb/storage/realtek_cr.c static int init_realtek_cr(struct us_data *us); us 201 drivers/usb/storage/realtek_cr.c static int rts51x_bulk_transport(struct us_data *us, u8 lun, us 205 drivers/usb/storage/realtek_cr.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *)us->iobuf; us 206 drivers/usb/storage/realtek_cr.c struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *)us->iobuf; us 216 drivers/usb/storage/realtek_cr.c bcb->Tag = ++us->tag; us 225 drivers/usb/storage/realtek_cr.c result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 235 drivers/usb/storage/realtek_cr.c us->recv_bulk_pipe : us->send_bulk_pipe; us 236 drivers/usb/storage/realtek_cr.c result = usb_stor_bulk_transfer_buf(us, pipe, us 243 drivers/usb/storage/realtek_cr.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 250 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Signature mismatch: got %08X, expecting %08X\n", us 256 drivers/usb/storage/realtek_cr.c if (bcs->Tag != us->tag) us 291 drivers/usb/storage/realtek_cr.c static int rts51x_bulk_transport_special(struct us_data *us, u8 lun, us 295 drivers/usb/storage/realtek_cr.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 296 drivers/usb/storage/realtek_cr.c struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) us->iobuf; us 305 drivers/usb/storage/realtek_cr.c bcb->Tag = ++us->tag; us 314 drivers/usb/storage/realtek_cr.c result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 324 drivers/usb/storage/realtek_cr.c us->recv_bulk_pipe : us->send_bulk_pipe; us 325 drivers/usb/storage/realtek_cr.c result = usb_stor_bulk_transfer_buf(us, pipe, us 332 drivers/usb/storage/realtek_cr.c result = usb_bulk_msg(us->pusb_dev, us->recv_bulk_pipe, bcs, us 338 drivers/usb/storage/realtek_cr.c static int rts51x_get_max_lun(struct us_data *us) us 343 drivers/usb/storage/realtek_cr.c us->iobuf[0] = 0; us 344 drivers/usb/storage/realtek_cr.c result = usb_stor_control_msg(us, us->recv_ctrl_pipe, us 348 drivers/usb/storage/realtek_cr.c 0, us->ifnum, us->iobuf, 1, 10 * HZ); us 350 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "GetMaxLUN command result is %d, data is %d\n", us 351 drivers/usb/storage/realtek_cr.c result, us->iobuf[0]); us 355 drivers/usb/storage/realtek_cr.c return us->iobuf[0]; us 360 drivers/usb/storage/realtek_cr.c static int rts51x_read_mem(struct us_data *us, u16 addr, u8 *data, u16 len) us 370 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "addr = 0x%x, len = %d\n", addr, len); us 379 drivers/usb/storage/realtek_cr.c retval = rts51x_bulk_transport(us, 0, cmnd, 12, us 391 drivers/usb/storage/realtek_cr.c static int rts51x_write_mem(struct us_data *us, u16 addr, u8 *data, u16 len) us 401 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "addr = 0x%x, len = %d\n", addr, len); us 410 drivers/usb/storage/realtek_cr.c retval = rts51x_bulk_transport(us, 0, cmnd, 12, us 419 drivers/usb/storage/realtek_cr.c static int rts51x_read_status(struct us_data *us, us 430 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "lun = %d\n", lun); us 435 drivers/usb/storage/realtek_cr.c retval = rts51x_bulk_transport(us, lun, cmnd, 12, us 447 drivers/usb/storage/realtek_cr.c static int rts51x_check_status(struct us_data *us, u8 lun) us 449 drivers/usb/storage/realtek_cr.c struct rts51x_chip *chip = (struct rts51x_chip *)(us->extra); us 453 drivers/usb/storage/realtek_cr.c retval = rts51x_read_status(us, lun, buf, 16, &(chip->status_len)); us 457 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "chip->status_len = %d\n", chip->status_len); us 478 drivers/usb/storage/realtek_cr.c static int enable_oscillator(struct us_data *us) us 483 drivers/usb/storage/realtek_cr.c retval = rts51x_read_mem(us, 0xFE77, &value, 1); us 488 drivers/usb/storage/realtek_cr.c retval = rts51x_write_mem(us, 0xFE77, &value, 1); us 492 drivers/usb/storage/realtek_cr.c retval = rts51x_read_mem(us, 0xFE77, &value, 1); us 502 drivers/usb/storage/realtek_cr.c static int __do_config_autodelink(struct us_data *us, u8 *data, u16 len) us 508 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "addr = 0xfe47, len = %d\n", len); us 521 drivers/usb/storage/realtek_cr.c retval = rts51x_bulk_transport_special(us, 0, cmnd, 12, buf, len, DMA_TO_DEVICE, NULL); us 530 drivers/usb/storage/realtek_cr.c static int do_config_autodelink(struct us_data *us, int enable, int force) us 535 drivers/usb/storage/realtek_cr.c retval = rts51x_read_mem(us, 0xFE47, &value, 1); us 548 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "set 0xfe47 to 0x%x\n", value); us 551 drivers/usb/storage/realtek_cr.c retval = __do_config_autodelink(us, &value, 1); us 558 drivers/usb/storage/realtek_cr.c static int config_autodelink_after_power_on(struct us_data *us) us 560 drivers/usb/storage/realtek_cr.c struct rts51x_chip *chip = (struct rts51x_chip *)(us->extra); us 567 drivers/usb/storage/realtek_cr.c retval = rts51x_read_mem(us, 0xFE47, &value, 1); us 582 drivers/usb/storage/realtek_cr.c retval = __do_config_autodelink(us, &value, 1); us 586 drivers/usb/storage/realtek_cr.c retval = enable_oscillator(us); us 588 drivers/usb/storage/realtek_cr.c (void)do_config_autodelink(us, 1, 0); us 604 drivers/usb/storage/realtek_cr.c retval = __do_config_autodelink(us, &value, 1); us 610 drivers/usb/storage/realtek_cr.c retval = rts51x_write_mem(us, 0xFE79, &value, 1); us 615 drivers/usb/storage/realtek_cr.c retval = rts51x_write_mem(us, 0x48, &value, 1); us 625 drivers/usb/storage/realtek_cr.c static int config_autodelink_before_power_down(struct us_data *us) us 627 drivers/usb/storage/realtek_cr.c struct rts51x_chip *chip = (struct rts51x_chip *)(us->extra); us 635 drivers/usb/storage/realtek_cr.c retval = rts51x_read_mem(us, 0xFE77, &value, 1); us 640 drivers/usb/storage/realtek_cr.c retval = rts51x_write_mem(us, 0xFE77, &value, 1); us 646 drivers/usb/storage/realtek_cr.c retval = rts51x_write_mem(us, 0x48, &value, 1); us 651 drivers/usb/storage/realtek_cr.c retval = rts51x_read_mem(us, 0xFE47, &value, 1); us 658 drivers/usb/storage/realtek_cr.c retval = rts51x_write_mem(us, 0xFE77, &value, 1); us 665 drivers/usb/storage/realtek_cr.c retval = rts51x_read_mem(us, 0xFE47, &value, 1); us 679 drivers/usb/storage/realtek_cr.c retval = __do_config_autodelink(us, &value, 1); us 686 drivers/usb/storage/realtek_cr.c retval = rts51x_write_mem(us, 0x48, &value, 1); us 695 drivers/usb/storage/realtek_cr.c static void fw5895_init(struct us_data *us) us 697 drivers/usb/storage/realtek_cr.c struct rts51x_chip *chip = (struct rts51x_chip *)(us->extra); us 702 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Not the specified device, return immediately!\n"); us 704 drivers/usb/storage/realtek_cr.c retval = rts51x_read_mem(us, 0xFD6F, &val, 1); us 707 drivers/usb/storage/realtek_cr.c retval = rts51x_write_mem(us, 0xFD70, &val, 1); us 709 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Write memory fail\n"); us 711 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Read memory fail, OR (val & 0x1F) != 0\n"); us 718 drivers/usb/storage/realtek_cr.c static void fw5895_set_mmc_wp(struct us_data *us) us 720 drivers/usb/storage/realtek_cr.c struct rts51x_chip *chip = (struct rts51x_chip *)(us->extra); us 725 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Not the specified device, return immediately!\n"); us 727 drivers/usb/storage/realtek_cr.c retval = rts51x_read_mem(us, 0xFD6F, buf, 1); us 730 drivers/usb/storage/realtek_cr.c retval = rts51x_read_mem(us, 0xD04E, buf, 1); us 733 drivers/usb/storage/realtek_cr.c retval = rts51x_write_mem(us, 0xFD70, buf, 1); us 735 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Write memory fail\n"); us 737 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Read memory fail\n"); us 740 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Read memory fail, OR (buf[0]&0x24)!=0x24\n"); us 747 drivers/usb/storage/realtek_cr.c struct us_data *us = chip->us; us 749 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "state:%d\n", rts51x_get_stat(chip)); us 758 drivers/usb/storage/realtek_cr.c struct us_data *us = chip->us; us 767 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "RTS51X_STAT_SS, power.usage:%d\n", us 768 drivers/usb/storage/realtek_cr.c atomic_read(&us->pusb_intf->dev.power.usage_count)); us 770 drivers/usb/storage/realtek_cr.c if (atomic_read(&us->pusb_intf->dev.power.usage_count) > 0) { us 771 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Ready to enter SS state\n"); us 774 drivers/usb/storage/realtek_cr.c pm_suspend_ignore_children(&us->pusb_intf->dev, true); us 775 drivers/usb/storage/realtek_cr.c usb_autopm_put_interface_async(us->pusb_intf); us 776 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "RTS51X_STAT_SS 01, power.usage:%d\n", us 777 drivers/usb/storage/realtek_cr.c atomic_read(&us->pusb_intf->dev.power.usage_count)); us 781 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Unknown state !!!\n"); us 796 drivers/usb/storage/realtek_cr.c static void rts51x_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) us 798 drivers/usb/storage/realtek_cr.c struct rts51x_chip *chip = (struct rts51x_chip *)(us->extra); us 809 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "working scsi, power.usage:%d\n", us 810 drivers/usb/storage/realtek_cr.c atomic_read(&us->pusb_intf->dev.power.usage_count)); us 812 drivers/usb/storage/realtek_cr.c if (atomic_read(&us->pusb_intf->dev.power.usage_count) <= 0) { us 813 drivers/usb/storage/realtek_cr.c ret = usb_autopm_get_interface(us->pusb_intf); us 814 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "working scsi, ret=%d\n", ret); us 818 drivers/usb/storage/realtek_cr.c chip->proto_handler_backup(srb, us); us 821 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "NOT working scsi\n"); us 832 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "TEST_UNIT_READY\n"); us 845 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "ALLOW_MEDIUM_REMOVAL\n"); us 849 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "NOT working scsi, not SS\n"); us 850 drivers/usb/storage/realtek_cr.c chip->proto_handler_backup(srb, us); us 857 drivers/usb/storage/realtek_cr.c fw5895_set_mmc_wp(us); us 869 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "state:%d\n", rts51x_get_stat(chip)); us 874 drivers/usb/storage/realtek_cr.c static int realtek_cr_autosuspend_setup(struct us_data *us) us 881 drivers/usb/storage/realtek_cr.c chip = (struct rts51x_chip *)us->extra; us 887 drivers/usb/storage/realtek_cr.c retval = rts51x_read_status(us, 0, buf, 16, &(chip->status_len)); us 889 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "Read status fail\n"); us 910 drivers/usb/storage/realtek_cr.c chip = (struct rts51x_chip *)(us->extra); us 911 drivers/usb/storage/realtek_cr.c chip->proto_handler_backup = us->proto_handler; us 913 drivers/usb/storage/realtek_cr.c pm_runtime_set_autosuspend_delay(&us->pusb_dev->dev, 0); us 915 drivers/usb/storage/realtek_cr.c us->proto_handler = rts51x_invoke_transport; us 919 drivers/usb/storage/realtek_cr.c fw5895_init(us); us 922 drivers/usb/storage/realtek_cr.c usb_enable_autosuspend(us->pusb_dev); us 947 drivers/usb/storage/realtek_cr.c struct us_data *us = usb_get_intfdata(iface); us 950 drivers/usb/storage/realtek_cr.c mutex_lock(&us->dev_mutex); us 952 drivers/usb/storage/realtek_cr.c config_autodelink_before_power_down(us); us 954 drivers/usb/storage/realtek_cr.c mutex_unlock(&us->dev_mutex); us 961 drivers/usb/storage/realtek_cr.c struct us_data *us = usb_get_intfdata(iface); us 963 drivers/usb/storage/realtek_cr.c fw5895_init(us); us 964 drivers/usb/storage/realtek_cr.c config_autodelink_after_power_on(us); us 973 drivers/usb/storage/realtek_cr.c static int init_realtek_cr(struct us_data *us) us 982 drivers/usb/storage/realtek_cr.c us->extra = chip; us 983 drivers/usb/storage/realtek_cr.c us->extra_destructor = realtek_cr_destructor; us 984 drivers/usb/storage/realtek_cr.c us->max_lun = chip->max_lun = rts51x_get_max_lun(us); us 985 drivers/usb/storage/realtek_cr.c chip->us = us; us 987 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "chip->max_lun = %d\n", chip->max_lun); us 995 drivers/usb/storage/realtek_cr.c retval = rts51x_check_status(us, (u8) i); us 1012 drivers/usb/storage/realtek_cr.c realtek_cr_autosuspend_setup(us); us 1015 drivers/usb/storage/realtek_cr.c usb_stor_dbg(us, "chip->flag = 0x%x\n", chip->flag); us 1017 drivers/usb/storage/realtek_cr.c (void)config_autodelink_after_power_on(us); us 1022 drivers/usb/storage/realtek_cr.c if (us->extra) { us 1024 drivers/usb/storage/realtek_cr.c kfree(us->extra); us 1025 drivers/usb/storage/realtek_cr.c us->extra = NULL; us 1036 drivers/usb/storage/realtek_cr.c struct us_data *us; us 1041 drivers/usb/storage/realtek_cr.c result = usb_stor_probe1(&us, intf, id, us 1048 drivers/usb/storage/realtek_cr.c result = usb_stor_probe2(us); us 64 drivers/usb/storage/scsiglue.c struct us_data *us = host_to_us(host); us 65 drivers/usb/storage/scsiglue.c return us->scsi_name; us 70 drivers/usb/storage/scsiglue.c struct us_data *us = host_to_us(sdev->host); us 86 drivers/usb/storage/scsiglue.c if (us->protocol == USB_PR_BULK && us->max_lun > 0) us 94 drivers/usb/storage/scsiglue.c struct us_data *us = host_to_us(sdev->host); us 95 drivers/usb/storage/scsiglue.c struct device *dev = us->pusb_dev->bus->sysdev; us 102 drivers/usb/storage/scsiglue.c if (us->fflags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) { us 105 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_MAX_SECTORS_MIN) us 117 drivers/usb/storage/scsiglue.c } else if (us->pusb_dev->speed >= USB_SPEED_SUPER) { us 138 drivers/usb/storage/scsiglue.c if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus)) || us 139 drivers/usb/storage/scsiglue.c (bus_to_hcd(us->pusb_dev->bus)->localmem_pool != NULL)) us 157 drivers/usb/storage/scsiglue.c switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) { us 162 drivers/usb/storage/scsiglue.c if (!(us->fflags & (US_FL_FIX_CAPACITY | us 164 drivers/usb/storage/scsiglue.c us->fflags |= US_FL_CAPACITY_HEURISTICS; us 173 drivers/usb/storage/scsiglue.c if (us->subclass != USB_SC_SCSI && us->subclass != USB_SC_CYP_ATACB) us 191 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_NO_WP_DETECT) us 217 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_FIX_CAPACITY) us 225 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_CAPACITY_HEURISTICS) us 229 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_NO_READ_CAPACITY_16) us 238 drivers/usb/storage/scsiglue.c if (!(us->fflags & US_FL_NEEDS_CAP16)) us 246 drivers/usb/storage/scsiglue.c !(us->fflags & US_FL_BAD_SENSE)) us 247 drivers/usb/storage/scsiglue.c us->fflags |= US_FL_SANE_SENSE; us 277 drivers/usb/storage/scsiglue.c if (!(us->fflags & (US_FL_FIX_CAPACITY | US_FL_CAPACITY_OK | us 279 drivers/usb/storage/scsiglue.c us->protocol == USB_PR_BULK) us 280 drivers/usb/storage/scsiglue.c us->use_last_sector_hacks = 1; us 283 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_WRITE_CACHE) us 287 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_BROKEN_FUA) us 291 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_ALWAYS_SYNC) { us 308 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_NO_READ_DISC_INFO) us 319 drivers/usb/storage/scsiglue.c if ((us->protocol == USB_PR_CB || us->protocol == USB_PR_CBI) && us 321 drivers/usb/storage/scsiglue.c us->max_lun = 0; us 327 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_NOT_LOCKABLE) us 339 drivers/usb/storage/scsiglue.c struct us_data *us = host_to_us(dev_to_shost(starget->dev.parent)); us 358 drivers/usb/storage/scsiglue.c if (us->subclass == USB_SC_UFI) us 369 drivers/usb/storage/scsiglue.c struct us_data *us = host_to_us(srb->device->host); us 372 drivers/usb/storage/scsiglue.c if (us->srb != NULL) { us 374 drivers/usb/storage/scsiglue.c __func__, us->srb); us 379 drivers/usb/storage/scsiglue.c if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) { us 380 drivers/usb/storage/scsiglue.c usb_stor_dbg(us, "Fail command during disconnect\n"); us 386 drivers/usb/storage/scsiglue.c if ((us->fflags & US_FL_NO_ATA_1X) && us 397 drivers/usb/storage/scsiglue.c us->srb = srb; us 398 drivers/usb/storage/scsiglue.c complete(&us->cmnd_ready); us 412 drivers/usb/storage/scsiglue.c struct us_data *us = host_to_us(srb->device->host); us 414 drivers/usb/storage/scsiglue.c usb_stor_dbg(us, "%s called\n", __func__); us 420 drivers/usb/storage/scsiglue.c scsi_lock(us_to_host(us)); us 423 drivers/usb/storage/scsiglue.c if (us->srb != srb) { us 424 drivers/usb/storage/scsiglue.c scsi_unlock(us_to_host(us)); us 425 drivers/usb/storage/scsiglue.c usb_stor_dbg(us, "-- nothing to abort\n"); us 436 drivers/usb/storage/scsiglue.c set_bit(US_FLIDX_TIMED_OUT, &us->dflags); us 437 drivers/usb/storage/scsiglue.c if (!test_bit(US_FLIDX_RESETTING, &us->dflags)) { us 438 drivers/usb/storage/scsiglue.c set_bit(US_FLIDX_ABORTING, &us->dflags); us 439 drivers/usb/storage/scsiglue.c usb_stor_stop_transport(us); us 441 drivers/usb/storage/scsiglue.c scsi_unlock(us_to_host(us)); us 444 drivers/usb/storage/scsiglue.c wait_for_completion(&us->notify); us 454 drivers/usb/storage/scsiglue.c struct us_data *us = host_to_us(srb->device->host); us 457 drivers/usb/storage/scsiglue.c usb_stor_dbg(us, "%s called\n", __func__); us 460 drivers/usb/storage/scsiglue.c mutex_lock(&(us->dev_mutex)); us 461 drivers/usb/storage/scsiglue.c result = us->transport_reset(us); us 462 drivers/usb/storage/scsiglue.c mutex_unlock(&us->dev_mutex); us 470 drivers/usb/storage/scsiglue.c struct us_data *us = host_to_us(srb->device->host); us 473 drivers/usb/storage/scsiglue.c usb_stor_dbg(us, "%s called\n", __func__); us 475 drivers/usb/storage/scsiglue.c result = usb_stor_port_reset(us); us 484 drivers/usb/storage/scsiglue.c void usb_stor_report_device_reset(struct us_data *us) us 487 drivers/usb/storage/scsiglue.c struct Scsi_Host *host = us_to_host(us); us 490 drivers/usb/storage/scsiglue.c if (us->fflags & US_FL_SCM_MULT_TARG) { us 501 drivers/usb/storage/scsiglue.c void usb_stor_report_bus_reset(struct us_data *us) us 503 drivers/usb/storage/scsiglue.c struct Scsi_Host *host = us_to_host(us); us 522 drivers/usb/storage/scsiglue.c struct us_data *us = host_to_us(host); us 529 drivers/usb/storage/scsiglue.c if (us->pusb_dev->manufacturer) us 530 drivers/usb/storage/scsiglue.c string = us->pusb_dev->manufacturer; us 531 drivers/usb/storage/scsiglue.c else if (us->unusual_dev->vendorName) us 532 drivers/usb/storage/scsiglue.c string = us->unusual_dev->vendorName; us 536 drivers/usb/storage/scsiglue.c if (us->pusb_dev->product) us 537 drivers/usb/storage/scsiglue.c string = us->pusb_dev->product; us 538 drivers/usb/storage/scsiglue.c else if (us->unusual_dev->productName) us 539 drivers/usb/storage/scsiglue.c string = us->unusual_dev->productName; us 543 drivers/usb/storage/scsiglue.c if (us->pusb_dev->serial) us 544 drivers/usb/storage/scsiglue.c string = us->pusb_dev->serial; us 550 drivers/usb/storage/scsiglue.c seq_printf(m, " Protocol: %s\n", us->protocol_name); us 551 drivers/usb/storage/scsiglue.c seq_printf(m, " Transport: %s\n", us->transport_name); us 557 drivers/usb/storage/scsiglue.c if (us->fflags & value) seq_printf(m, " " #name); us 27 drivers/usb/storage/scsiglue.h extern void usb_stor_report_device_reset(struct us_data *us); us 28 drivers/usb/storage/scsiglue.h extern void usb_stor_report_bus_reset(struct us_data *us); us 52 drivers/usb/storage/sddr09.c static int usb_stor_sddr09_dpcm_init(struct us_data *us); us 53 drivers/usb/storage/sddr09.c static int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us); us 54 drivers/usb/storage/sddr09.c static int usb_stor_sddr09_init(struct us_data *us); us 289 drivers/usb/storage/sddr09.c sddr09_send_command(struct us_data *us, us 301 drivers/usb/storage/sddr09.c pipe = us->recv_ctrl_pipe; us 303 drivers/usb/storage/sddr09.c pipe = us->send_ctrl_pipe; us 305 drivers/usb/storage/sddr09.c rc = usb_stor_ctrl_transfer(us, pipe, request, requesttype, us 315 drivers/usb/storage/sddr09.c sddr09_send_scsi_command(struct us_data *us, us 318 drivers/usb/storage/sddr09.c return sddr09_send_command(us, 0, USB_DIR_OUT, command, command_len); us 327 drivers/usb/storage/sddr09.c sddr09_test_unit_ready(struct us_data *us) { us 328 drivers/usb/storage/sddr09.c unsigned char *command = us->iobuf; us 334 drivers/usb/storage/sddr09.c result = sddr09_send_scsi_command(us, command, 6); us 336 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "sddr09_test_unit_ready returns %d\n", result); us 348 drivers/usb/storage/sddr09.c sddr09_request_sense(struct us_data *us, unsigned char *sensebuf, int buflen) { us 349 drivers/usb/storage/sddr09.c unsigned char *command = us->iobuf; us 357 drivers/usb/storage/sddr09.c result = sddr09_send_scsi_command(us, command, 12); us 361 drivers/usb/storage/sddr09.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 389 drivers/usb/storage/sddr09.c sddr09_readX(struct us_data *us, int x, unsigned long fromaddress, us 393 drivers/usb/storage/sddr09.c unsigned char *command = us->iobuf; us 409 drivers/usb/storage/sddr09.c result = sddr09_send_scsi_command(us, command, 12); us 412 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Result for send_control in sddr09_read2%d %d\n", us 417 drivers/usb/storage/sddr09.c result = usb_stor_bulk_transfer_sg(us, us->recv_bulk_pipe, us 421 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Result for bulk_transfer in sddr09_read2%d %d\n", us 438 drivers/usb/storage/sddr09.c sddr09_read20(struct us_data *us, unsigned long fromaddress, us 443 drivers/usb/storage/sddr09.c return sddr09_readX(us, 0, fromaddress, nr_of_pages, bulklen, us 461 drivers/usb/storage/sddr09.c sddr09_read21(struct us_data *us, unsigned long fromaddress, us 465 drivers/usb/storage/sddr09.c return sddr09_readX(us, 1, fromaddress, count, bulklen, us 479 drivers/usb/storage/sddr09.c sddr09_read22(struct us_data *us, unsigned long fromaddress, us 483 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "reading %d pages, %d bytes\n", nr_of_pages, bulklen); us 484 drivers/usb/storage/sddr09.c return sddr09_readX(us, 2, fromaddress, nr_of_pages, bulklen, us 503 drivers/usb/storage/sddr09.c sddr09_read23(struct us_data *us, unsigned long fromaddress, us 507 drivers/usb/storage/sddr09.c return sddr09_readX(us, 3, fromaddress, count, bulklen, us 522 drivers/usb/storage/sddr09.c sddr09_erase(struct us_data *us, unsigned long Eaddress) { us 523 drivers/usb/storage/sddr09.c unsigned char *command = us->iobuf; us 526 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "erase address %lu\n", Eaddress); us 536 drivers/usb/storage/sddr09.c result = sddr09_send_scsi_command(us, command, 12); us 539 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Result for send_control in sddr09_erase %d\n", us 571 drivers/usb/storage/sddr09.c sddr09_writeX(struct us_data *us, us 575 drivers/usb/storage/sddr09.c unsigned char *command = us->iobuf; us 594 drivers/usb/storage/sddr09.c result = sddr09_send_scsi_command(us, command, 12); us 597 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Result for send_control in sddr09_writeX %d\n", us 602 drivers/usb/storage/sddr09.c result = usb_stor_bulk_transfer_sg(us, us->send_bulk_pipe, us 606 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Result for bulk_transfer in sddr09_writeX %d\n", us 615 drivers/usb/storage/sddr09.c sddr09_write_inplace(struct us_data *us, unsigned long address, us 619 drivers/usb/storage/sddr09.c return sddr09_writeX(us, address, address, nr_of_pages, bulklen, us 636 drivers/usb/storage/sddr09.c sddr09_read_sg_test_only(struct us_data *us) { us 637 drivers/usb/storage/sddr09.c unsigned char *command = us->iobuf; us 672 drivers/usb/storage/sddr09.c result = sddr09_send_scsi_command(us, command, 4*nsg+3); us 675 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Result for send_control in sddr09_read_sg %d\n", us 684 drivers/usb/storage/sddr09.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 688 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Result for bulk_transfer in sddr09_read_sg %d\n", us 709 drivers/usb/storage/sddr09.c sddr09_read_status(struct us_data *us, unsigned char *status) { us 711 drivers/usb/storage/sddr09.c unsigned char *command = us->iobuf; us 712 drivers/usb/storage/sddr09.c unsigned char *data = us->iobuf; us 715 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Reading status...\n"); us 721 drivers/usb/storage/sddr09.c result = sddr09_send_scsi_command(us, command, 12); us 725 drivers/usb/storage/sddr09.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 732 drivers/usb/storage/sddr09.c sddr09_read_data(struct us_data *us, us 736 drivers/usb/storage/sddr09.c struct sddr09_card_info *info = (struct sddr09_card_info *) us->extra; us 775 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Error: Requested lba %u exceeds maximum %u\n", us 786 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Read %d zero pages (LBA %d) page %d\n", us 799 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Read %d pages, from PBA %d (LBA %d) page %d\n", us 805 drivers/usb/storage/sddr09.c result = sddr09_read20(us, address>>1, us 812 drivers/usb/storage/sddr09.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 851 drivers/usb/storage/sddr09.c sddr09_write_lba(struct us_data *us, unsigned int lba, us 855 drivers/usb/storage/sddr09.c struct sddr09_card_info *info = (struct sddr09_card_info *) us->extra; us 892 drivers/usb/storage/sddr09.c result = sddr09_read22(us, address>>1, info->blocksize, us 903 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Warning: bad ecc in page %d- of pba %d\n", us 909 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Warning: bad ecc in page %d+ of pba %d\n", us 930 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Rewrite PBA %d (LBA %d)\n", pba, lba); us 932 drivers/usb/storage/sddr09.c result = sddr09_write_inplace(us, address>>1, info->blocksize, us 935 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "sddr09_write_inplace returns %d\n", result); us 940 drivers/usb/storage/sddr09.c int result2 = sddr09_read_status(us, &status); us 942 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "cannot read status\n"); us 944 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "status after write: 0x%x\n", status); us 950 drivers/usb/storage/sddr09.c int result2 = sddr09_test_unit_ready(us); us 958 drivers/usb/storage/sddr09.c sddr09_write_data(struct us_data *us, us 962 drivers/usb/storage/sddr09.c struct sddr09_card_info *info = (struct sddr09_card_info *) us->extra; us 1020 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Error: Requested lba %u exceeds maximum %u\n", us 1027 drivers/usb/storage/sddr09.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 1030 drivers/usb/storage/sddr09.c result = sddr09_write_lba(us, lba, page, pages, us 1047 drivers/usb/storage/sddr09.c sddr09_read_control(struct us_data *us, us 1053 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Read control address %lu, blocks %d\n", us 1056 drivers/usb/storage/sddr09.c return sddr09_read21(us, address, blocks, us 1071 drivers/usb/storage/sddr09.c sddr09_read_deviceID(struct us_data *us, unsigned char *deviceID) { us 1072 drivers/usb/storage/sddr09.c unsigned char *command = us->iobuf; us 1073 drivers/usb/storage/sddr09.c unsigned char *content = us->iobuf; us 1080 drivers/usb/storage/sddr09.c result = sddr09_send_scsi_command(us, command, 12); us 1084 drivers/usb/storage/sddr09.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 1094 drivers/usb/storage/sddr09.c sddr09_get_wp(struct us_data *us, struct sddr09_card_info *info) { us 1099 drivers/usb/storage/sddr09.c result = sddr09_read_status(us, &status); us 1101 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "read_status fails\n"); us 1110 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "status 0x%02X%s%s%s%s\n", status, wp_fmt, us 1124 drivers/usb/storage/sddr09.c sddr09_reset(struct us_data *us) { us 1126 drivers/usb/storage/sddr09.c unsigned char *command = us->iobuf; us 1132 drivers/usb/storage/sddr09.c return sddr09_send_scsi_command(us, command, 12); us 1137 drivers/usb/storage/sddr09.c sddr09_get_cardinfo(struct us_data *us, unsigned char flags) { us 1143 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Reading capacity...\n"); us 1145 drivers/usb/storage/sddr09.c result = sddr09_read_deviceID(us, deviceID); us 1148 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Result of read_deviceID is %d\n", result); us 1197 drivers/usb/storage/sddr09.c sddr09_read_map(struct us_data *us) { us 1199 drivers/usb/storage/sddr09.c struct sddr09_card_info *info = (struct sddr09_card_info *) us->extra; us 1259 drivers/usb/storage/sddr09.c us, address>>1, us 1358 drivers/usb/storage/sddr09.c sddr09_erase(us, address>>1); us 1385 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Found %d LBA's\n", lbact); us 1411 drivers/usb/storage/sddr09.c sddr09_common_init(struct us_data *us) { us 1415 drivers/usb/storage/sddr09.c if (us->pusb_dev->actconfig->desc.bConfigurationValue != 1) { us 1416 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "active config #%d != 1 ??\n", us 1417 drivers/usb/storage/sddr09.c us->pusb_dev->actconfig->desc.bConfigurationValue); us 1421 drivers/usb/storage/sddr09.c result = usb_reset_configuration(us->pusb_dev); us 1422 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Result of usb_reset_configuration is %d\n", result); us 1424 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "-- stall on control interface\n"); us 1427 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "-- Unknown error. Rejecting device\n"); us 1431 drivers/usb/storage/sddr09.c us->extra = kzalloc(sizeof(struct sddr09_card_info), GFP_NOIO); us 1432 drivers/usb/storage/sddr09.c if (!us->extra) us 1434 drivers/usb/storage/sddr09.c us->extra_destructor = sddr09_card_info_destructor; us 1447 drivers/usb/storage/sddr09.c usb_stor_sddr09_dpcm_init(struct us_data *us) { us 1449 drivers/usb/storage/sddr09.c unsigned char *data = us->iobuf; us 1451 drivers/usb/storage/sddr09.c result = sddr09_common_init(us); us 1455 drivers/usb/storage/sddr09.c result = sddr09_send_command(us, 0x01, USB_DIR_IN, data, 2); us 1457 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "send_command fails\n"); us 1461 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "%02X %02X\n", data[0], data[1]); us 1464 drivers/usb/storage/sddr09.c result = sddr09_send_command(us, 0x08, USB_DIR_IN, data, 2); us 1466 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "2nd send_command fails\n"); us 1470 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "%02X %02X\n", data[0], data[1]); us 1473 drivers/usb/storage/sddr09.c result = sddr09_request_sense(us, data, 18); us 1496 drivers/usb/storage/sddr09.c static int dpcm_transport(struct scsi_cmnd *srb, struct us_data *us) us 1500 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "LUN=%d\n", (u8)srb->device->lun); us 1508 drivers/usb/storage/sddr09.c ret = usb_stor_CB_transport(srb, us); us 1521 drivers/usb/storage/sddr09.c ret = sddr09_transport(srb, us); us 1526 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Invalid LUN %d\n", (u8)srb->device->lun); us 1537 drivers/usb/storage/sddr09.c static int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us) us 1542 drivers/usb/storage/sddr09.c unsigned char *ptr = us->iobuf; us 1559 drivers/usb/storage/sddr09.c info = (struct sddr09_card_info *)us->extra; us 1582 drivers/usb/storage/sddr09.c fill_inquiry_response(us, ptr, 36); us 1589 drivers/usb/storage/sddr09.c sddr09_get_wp(us, info); /* read WP bit */ us 1591 drivers/usb/storage/sddr09.c cardinfo = sddr09_get_cardinfo(us, info->flags); us 1608 drivers/usb/storage/sddr09.c if (sddr09_read_map(us)) { us 1636 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Dummy up request for mode page 0x%x\n", us 1663 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "READ_10: read page %d pagect %d\n", us 1666 drivers/usb/storage/sddr09.c result = sddr09_read_data(us, page, pages); us 1678 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "WRITE_10: write page %d pagect %d\n", us 1681 drivers/usb/storage/sddr09.c result = sddr09_write_data(us, page, pages); us 1707 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "Send control for command %s\n", ptr); us 1709 drivers/usb/storage/sddr09.c result = sddr09_send_scsi_command(us, srb->cmnd, 12); us 1711 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "sddr09_send_scsi_command returns %d\n", us 1722 drivers/usb/storage/sddr09.c ? us->send_bulk_pipe : us->recv_bulk_pipe; us 1724 drivers/usb/storage/sddr09.c usb_stor_dbg(us, "%s %d bytes\n", us 1729 drivers/usb/storage/sddr09.c result = usb_stor_bulk_srb(us, pipe, srb); us 1742 drivers/usb/storage/sddr09.c usb_stor_sddr09_init(struct us_data *us) { us 1743 drivers/usb/storage/sddr09.c return sddr09_common_init(us); us 1751 drivers/usb/storage/sddr09.c struct us_data *us; us 1754 drivers/usb/storage/sddr09.c result = usb_stor_probe1(&us, intf, id, us 1760 drivers/usb/storage/sddr09.c if (us->protocol == USB_PR_DPCM_USB) { us 1761 drivers/usb/storage/sddr09.c us->transport_name = "Control/Bulk-EUSB/SDDR09"; us 1762 drivers/usb/storage/sddr09.c us->transport = dpcm_transport; us 1763 drivers/usb/storage/sddr09.c us->transport_reset = usb_stor_CB_reset; us 1764 drivers/usb/storage/sddr09.c us->max_lun = 1; us 1766 drivers/usb/storage/sddr09.c us->transport_name = "EUSB/SDDR09"; us 1767 drivers/usb/storage/sddr09.c us->transport = sddr09_transport; us 1768 drivers/usb/storage/sddr09.c us->transport_reset = usb_stor_CB_reset; us 1769 drivers/usb/storage/sddr09.c us->max_lun = 0; us 1772 drivers/usb/storage/sddr09.c result = usb_stor_probe2(us); us 110 drivers/usb/storage/sddr55.c sddr55_bulk_transport(struct us_data *us, int direction, us 112 drivers/usb/storage/sddr55.c struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra; us 114 drivers/usb/storage/sddr55.c us->recv_bulk_pipe : us->send_bulk_pipe; us 119 drivers/usb/storage/sddr55.c return usb_stor_bulk_transfer_buf(us, pipe, data, len, NULL); us 127 drivers/usb/storage/sddr55.c static int sddr55_status(struct us_data *us) us 130 drivers/usb/storage/sddr55.c unsigned char *command = us->iobuf; us 131 drivers/usb/storage/sddr55.c unsigned char *status = us->iobuf; us 132 drivers/usb/storage/sddr55.c struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra; us 138 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, us 141 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Result for send_command in status %d\n", result); us 148 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, us 175 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, us 187 drivers/usb/storage/sddr55.c static int sddr55_read_data(struct us_data *us, us 193 drivers/usb/storage/sddr55.c unsigned char *command = us->iobuf; us 194 drivers/usb/storage/sddr55.c unsigned char *status = us->iobuf; us 195 drivers/usb/storage/sddr55.c struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra; us 231 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Read %02X pages, from PBA %04X (LBA %04X) page %02X\n", us 252 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, us 255 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Result for send_command in read_data %d\n", us 264 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, us 273 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, us 290 drivers/usb/storage/sddr55.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 306 drivers/usb/storage/sddr55.c static int sddr55_write_data(struct us_data *us, us 312 drivers/usb/storage/sddr55.c unsigned char *command = us->iobuf; us 313 drivers/usb/storage/sddr55.c unsigned char *status = us->iobuf; us 314 drivers/usb/storage/sddr55.c struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra; us 359 drivers/usb/storage/sddr55.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 362 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Write %02X pages, to PBA %04X (LBA %04X) page %02X\n", us 377 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "No PBA for LBA %04X\n", lba); us 400 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Couldn't find unallocated block\n"); us 407 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Allocating PBA %04X for LBA %04X\n", us 429 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, us 433 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Result for send_command in write_data %d\n", us 443 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, us 447 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Result for send_data in write_data %d\n", us 457 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, DMA_FROM_DEVICE, status, 6); us 460 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Result for get_status in write_data %d\n", us 481 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Updating maps for LBA %04X: old PBA %04X, new PBA %04X\n", us 512 drivers/usb/storage/sddr55.c static int sddr55_read_deviceID(struct us_data *us, us 517 drivers/usb/storage/sddr55.c unsigned char *command = us->iobuf; us 518 drivers/usb/storage/sddr55.c unsigned char *content = us->iobuf; us 523 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, DMA_TO_DEVICE, command, 8); us 525 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Result of send_control for device ID is %d\n", us 531 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, us 541 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, us 549 drivers/usb/storage/sddr55.c static int sddr55_reset(struct us_data *us) us 555 drivers/usb/storage/sddr55.c static unsigned long sddr55_get_capacity(struct us_data *us) { us 560 drivers/usb/storage/sddr55.c struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra; us 562 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Reading capacity...\n"); us 564 drivers/usb/storage/sddr55.c result = sddr55_read_deviceID(us, us 568 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Result of read_deviceID is %d\n", result); us 573 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Device ID = %02X\n", deviceID); us 574 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Manuf ID = %02X\n", manufacturerID); us 639 drivers/usb/storage/sddr55.c static int sddr55_read_map(struct us_data *us) { us 641 drivers/usb/storage/sddr55.c struct sddr55_card_info *info = (struct sddr55_card_info *)(us->extra); us 644 drivers/usb/storage/sddr55.c unsigned char *command = us->iobuf; us 665 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, DMA_TO_DEVICE, command, 8); us 672 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, DMA_FROM_DEVICE, buffer, numblocks * 2); us 679 drivers/usb/storage/sddr55.c result = sddr55_bulk_transport(us, DMA_FROM_DEVICE, command, 2); us 751 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "LBA %04X <-> PBA %04X\n", lba, i); us 775 drivers/usb/storage/sddr55.c static int sddr55_transport(struct scsi_cmnd *srb, struct us_data *us) us 787 drivers/usb/storage/sddr55.c unsigned char *ptr = us->iobuf; us 795 drivers/usb/storage/sddr55.c if (!us->extra) { us 796 drivers/usb/storage/sddr55.c us->extra = kzalloc( us 798 drivers/usb/storage/sddr55.c if (!us->extra) us 800 drivers/usb/storage/sddr55.c us->extra_destructor = sddr55_card_info_destructor; us 803 drivers/usb/storage/sddr55.c info = (struct sddr55_card_info *)(us->extra); us 806 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "request sense %02x/%02x/%02x\n", us 829 drivers/usb/storage/sddr55.c fill_inquiry_response(us, ptr, 36); us 840 drivers/usb/storage/sddr55.c result = sddr55_status (us); us 842 drivers/usb/storage/sddr55.c result = sddr55_status (us); us 862 drivers/usb/storage/sddr55.c capacity = sddr55_get_capacity(us); us 890 drivers/usb/storage/sddr55.c sddr55_read_map(us); us 902 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Dummy up request for mode page 1\n"); us 906 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Dummy up request for all mode pages\n"); us 916 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "%s medium removal. Not that I can do anything about it...\n", us 941 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "Error: Requested LBA %04X exceeds maximum block %04X\n", us 952 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "WRITE_10: write block %04X (LBA %04X) page %01X pages %d\n", us 955 drivers/usb/storage/sddr55.c return sddr55_write_data(us, lba, page, pages); us 957 drivers/usb/storage/sddr55.c usb_stor_dbg(us, "READ_10: read block %04X (LBA %04X) page %01X pages %d\n", us 960 drivers/usb/storage/sddr55.c return sddr55_read_data(us, lba, page, pages); us 983 drivers/usb/storage/sddr55.c struct us_data *us; us 986 drivers/usb/storage/sddr55.c result = usb_stor_probe1(&us, intf, id, us 992 drivers/usb/storage/sddr55.c us->transport_name = "SDDR55"; us 993 drivers/usb/storage/sddr55.c us->transport = sddr55_transport; us 994 drivers/usb/storage/sddr55.c us->transport_reset = sddr55_reset; us 995 drivers/usb/storage/sddr55.c us->max_lun = 0; us 997 drivers/usb/storage/sddr55.c result = usb_stor_probe2(us); us 149 drivers/usb/storage/shuttle_usbat.c static int usbat_flash_transport(struct scsi_cmnd * srb, struct us_data *us); us 150 drivers/usb/storage/shuttle_usbat.c static int usbat_hp8200e_transport(struct scsi_cmnd *srb, struct us_data *us); us 152 drivers/usb/storage/shuttle_usbat.c static int init_usbat_cd(struct us_data *us); us 153 drivers/usb/storage/shuttle_usbat.c static int init_usbat_flash(struct us_data *us); us 214 drivers/usb/storage/shuttle_usbat.c static int usbat_get_device_type(struct us_data *us) us 216 drivers/usb/storage/shuttle_usbat.c return ((struct usbat_info*)us->extra)->devicetype; us 222 drivers/usb/storage/shuttle_usbat.c static int usbat_read(struct us_data *us, us 227 drivers/usb/storage/shuttle_usbat.c return usb_stor_ctrl_transfer(us, us 228 drivers/usb/storage/shuttle_usbat.c us->recv_ctrl_pipe, us 240 drivers/usb/storage/shuttle_usbat.c static int usbat_write(struct us_data *us, us 245 drivers/usb/storage/shuttle_usbat.c return usb_stor_ctrl_transfer(us, us 246 drivers/usb/storage/shuttle_usbat.c us->send_ctrl_pipe, us 258 drivers/usb/storage/shuttle_usbat.c static int usbat_bulk_read(struct us_data *us, us 266 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "len = %d\n", len); us 267 drivers/usb/storage/shuttle_usbat.c return usb_stor_bulk_transfer_sg(us, us->recv_bulk_pipe, buf, len, use_sg, NULL); us 273 drivers/usb/storage/shuttle_usbat.c static int usbat_bulk_write(struct us_data *us, us 281 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "len = %d\n", len); us 282 drivers/usb/storage/shuttle_usbat.c return usb_stor_bulk_transfer_sg(us, us->send_bulk_pipe, buf, len, use_sg, NULL); us 290 drivers/usb/storage/shuttle_usbat.c static int usbat_execute_command(struct us_data *us, us 294 drivers/usb/storage/shuttle_usbat.c return usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, us 302 drivers/usb/storage/shuttle_usbat.c static int usbat_get_status(struct us_data *us, unsigned char *status) us 305 drivers/usb/storage/shuttle_usbat.c rc = usbat_read(us, USBAT_ATA, USBAT_ATA_STATUS, status); us 307 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "0x%02X\n", *status); us 314 drivers/usb/storage/shuttle_usbat.c static int usbat_check_status(struct us_data *us) us 316 drivers/usb/storage/shuttle_usbat.c unsigned char *reply = us->iobuf; us 319 drivers/usb/storage/shuttle_usbat.c rc = usbat_get_status(us, reply); us 338 drivers/usb/storage/shuttle_usbat.c static int usbat_set_shuttle_features(struct us_data *us, us 346 drivers/usb/storage/shuttle_usbat.c unsigned char *command = us->iobuf; us 387 drivers/usb/storage/shuttle_usbat.c return usbat_execute_command(us, command, 8); us 394 drivers/usb/storage/shuttle_usbat.c static int usbat_wait_not_busy(struct us_data *us, int minutes) us 398 drivers/usb/storage/shuttle_usbat.c unsigned char *status = us->iobuf; us 409 drivers/usb/storage/shuttle_usbat.c result = usbat_get_status(us, status); us 414 drivers/usb/storage/shuttle_usbat.c result = usbat_read(us, USBAT_ATA, 0x10, status); us 421 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Waited not busy for %d steps\n", i); us 435 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Waited not busy for %d minutes, timing out\n", us 443 drivers/usb/storage/shuttle_usbat.c static int usbat_read_block(struct us_data *us, us 449 drivers/usb/storage/shuttle_usbat.c unsigned char *command = us->iobuf; us 463 drivers/usb/storage/shuttle_usbat.c result = usbat_execute_command(us, command, 8); us 467 drivers/usb/storage/shuttle_usbat.c result = usbat_bulk_read(us, buf, len, use_sg); us 475 drivers/usb/storage/shuttle_usbat.c static int usbat_write_block(struct us_data *us, us 483 drivers/usb/storage/shuttle_usbat.c unsigned char *command = us->iobuf; us 497 drivers/usb/storage/shuttle_usbat.c result = usbat_execute_command(us, command, 8); us 502 drivers/usb/storage/shuttle_usbat.c result = usbat_bulk_write(us, buf, len, use_sg); us 506 drivers/usb/storage/shuttle_usbat.c return usbat_wait_not_busy(us, minutes); us 512 drivers/usb/storage/shuttle_usbat.c static int usbat_hp8200e_rw_block_test(struct us_data *us, us 529 drivers/usb/storage/shuttle_usbat.c us->recv_bulk_pipe : us->send_bulk_pipe; us 531 drivers/usb/storage/shuttle_usbat.c unsigned char *command = us->iobuf; us 534 drivers/usb/storage/shuttle_usbat.c unsigned char *data = us->iobuf; us 535 drivers/usb/storage/shuttle_usbat.c unsigned char *status = us->iobuf; us 583 drivers/usb/storage/shuttle_usbat.c result = usbat_execute_command(us, command, cmdlen); us 595 drivers/usb/storage/shuttle_usbat.c result = usbat_bulk_write(us, data, num_registers*2, 0); us 601 drivers/usb/storage/shuttle_usbat.c result = usb_stor_bulk_transfer_sg(us, us 632 drivers/usb/storage/shuttle_usbat.c if (usb_stor_clear_halt(us, us 633 drivers/usb/storage/shuttle_usbat.c us->send_bulk_pipe) < 0) us 641 drivers/usb/storage/shuttle_usbat.c result = usbat_read(us, USBAT_ATA, us 653 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Redoing %s\n", us 660 drivers/usb/storage/shuttle_usbat.c return usbat_wait_not_busy(us, minutes); us 664 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Bummer! %s bulk data 20 times failed\n", us 677 drivers/usb/storage/shuttle_usbat.c static int usbat_multiple_write(struct us_data *us, us 683 drivers/usb/storage/shuttle_usbat.c unsigned char *data = us->iobuf; us 684 drivers/usb/storage/shuttle_usbat.c unsigned char *command = us->iobuf; us 703 drivers/usb/storage/shuttle_usbat.c result = usbat_execute_command(us, command, 8); us 714 drivers/usb/storage/shuttle_usbat.c result = usbat_bulk_write(us, data, num_registers*2, 0); us 718 drivers/usb/storage/shuttle_usbat.c if (usbat_get_device_type(us) == USBAT_DEV_HP8200) us 719 drivers/usb/storage/shuttle_usbat.c return usbat_wait_not_busy(us, 0); us 736 drivers/usb/storage/shuttle_usbat.c static int usbat_read_blocks(struct us_data *us, us 742 drivers/usb/storage/shuttle_usbat.c unsigned char *command = us->iobuf; us 754 drivers/usb/storage/shuttle_usbat.c result = usbat_execute_command(us, command, 8); us 759 drivers/usb/storage/shuttle_usbat.c result = usbat_bulk_read(us, buffer, len, use_sg); us 778 drivers/usb/storage/shuttle_usbat.c static int usbat_write_blocks(struct us_data *us, us 784 drivers/usb/storage/shuttle_usbat.c unsigned char *command = us->iobuf; us 796 drivers/usb/storage/shuttle_usbat.c result = usbat_execute_command(us, command, 8); us 801 drivers/usb/storage/shuttle_usbat.c result = usbat_bulk_write(us, buffer, len, use_sg); us 811 drivers/usb/storage/shuttle_usbat.c static int usbat_read_user_io(struct us_data *us, unsigned char *data_flags) us 815 drivers/usb/storage/shuttle_usbat.c result = usb_stor_ctrl_transfer(us, us 816 drivers/usb/storage/shuttle_usbat.c us->recv_ctrl_pipe, us 824 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "UIO register reads %02X\n", *data_flags); us 832 drivers/usb/storage/shuttle_usbat.c static int usbat_write_user_io(struct us_data *us, us 836 drivers/usb/storage/shuttle_usbat.c return usb_stor_ctrl_transfer(us, us 837 drivers/usb/storage/shuttle_usbat.c us->send_ctrl_pipe, us 850 drivers/usb/storage/shuttle_usbat.c static int usbat_device_reset(struct us_data *us) us 858 drivers/usb/storage/shuttle_usbat.c rc = usbat_write_user_io(us, us 868 drivers/usb/storage/shuttle_usbat.c rc = usbat_write_user_io(us, us 880 drivers/usb/storage/shuttle_usbat.c static int usbat_device_enable_cdt(struct us_data *us) us 885 drivers/usb/storage/shuttle_usbat.c rc = usbat_write_user_io(us, us 897 drivers/usb/storage/shuttle_usbat.c static int usbat_flash_check_media_present(struct us_data *us, us 901 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "no media detected\n"); us 911 drivers/usb/storage/shuttle_usbat.c static int usbat_flash_check_media_changed(struct us_data *us, us 915 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "media change detected\n"); us 925 drivers/usb/storage/shuttle_usbat.c static int usbat_flash_check_media(struct us_data *us, us 929 drivers/usb/storage/shuttle_usbat.c unsigned char *uio = us->iobuf; us 931 drivers/usb/storage/shuttle_usbat.c rc = usbat_read_user_io(us, uio); us 936 drivers/usb/storage/shuttle_usbat.c rc = usbat_flash_check_media_present(us, uio); us 945 drivers/usb/storage/shuttle_usbat.c rc = usbat_flash_check_media_changed(us, uio); us 949 drivers/usb/storage/shuttle_usbat.c rc = usbat_device_reset(us); us 952 drivers/usb/storage/shuttle_usbat.c rc = usbat_device_enable_cdt(us); us 958 drivers/usb/storage/shuttle_usbat.c rc = usbat_read_user_io(us, uio); us 976 drivers/usb/storage/shuttle_usbat.c static int usbat_identify_device(struct us_data *us, us 982 drivers/usb/storage/shuttle_usbat.c if (!us || !info) us 985 drivers/usb/storage/shuttle_usbat.c rc = usbat_device_reset(us); us 996 drivers/usb/storage/shuttle_usbat.c rc = usbat_write(us, USBAT_ATA, USBAT_ATA_CMD, 0xA1); us 1000 drivers/usb/storage/shuttle_usbat.c rc = usbat_get_status(us, &status); us 1007 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Detected HP8200 CDRW\n"); us 1011 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Detected Flash reader/writer\n"); us 1021 drivers/usb/storage/shuttle_usbat.c static int usbat_set_transport(struct us_data *us, us 1030 drivers/usb/storage/shuttle_usbat.c usbat_identify_device(us, info); us 1037 drivers/usb/storage/shuttle_usbat.c us->transport = usbat_hp8200e_transport; us 1041 drivers/usb/storage/shuttle_usbat.c us->transport = usbat_flash_transport; us 1051 drivers/usb/storage/shuttle_usbat.c static int usbat_flash_get_sector_count(struct us_data *us, us 1064 drivers/usb/storage/shuttle_usbat.c if (!us || !info) us 1072 drivers/usb/storage/shuttle_usbat.c rc = usbat_multiple_write(us, registers, command, 3); us 1074 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Gah! identify_device failed\n"); us 1080 drivers/usb/storage/shuttle_usbat.c if (usbat_get_status(us, &status) != USB_STOR_XFER_GOOD) { us 1088 drivers/usb/storage/shuttle_usbat.c rc = usbat_read_block(us, reply, 512, 0); us 1107 drivers/usb/storage/shuttle_usbat.c static int usbat_flash_read_data(struct us_data *us, us 1129 drivers/usb/storage/shuttle_usbat.c result = usbat_flash_check_media(us, info); us 1168 drivers/usb/storage/shuttle_usbat.c result = usbat_multiple_write(us, registers, command, 7); us 1173 drivers/usb/storage/shuttle_usbat.c result = usbat_read_blocks(us, buffer, len, 0); us 1177 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "%d bytes\n", len); us 1180 drivers/usb/storage/shuttle_usbat.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 1198 drivers/usb/storage/shuttle_usbat.c static int usbat_flash_write_data(struct us_data *us, us 1220 drivers/usb/storage/shuttle_usbat.c result = usbat_flash_check_media(us, info); us 1256 drivers/usb/storage/shuttle_usbat.c usb_stor_access_xfer_buf(buffer, len, us->srb, us 1263 drivers/usb/storage/shuttle_usbat.c result = usbat_multiple_write(us, registers, command, 7); us 1268 drivers/usb/storage/shuttle_usbat.c result = usbat_write_blocks(us, buffer, len, 0); us 1288 drivers/usb/storage/shuttle_usbat.c static int usbat_hp8200e_handle_read10(struct us_data *us, us 1300 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "transfersize %d\n", srb->transfersize); us 1304 drivers/usb/storage/shuttle_usbat.c result = usbat_hp8200e_rw_block_test(us, USBAT_ATA, us 1327 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "GPCMD_READ_CD: len %d\n", len); us 1333 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "transfersize 0, forcing %d\n", us 1344 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Max read is %d bytes\n", len); us 1373 drivers/usb/storage/shuttle_usbat.c result = usbat_hp8200e_rw_block_test(us, USBAT_ATA, us 1399 drivers/usb/storage/shuttle_usbat.c static int usbat_select_and_test_registers(struct us_data *us) us 1402 drivers/usb/storage/shuttle_usbat.c unsigned char *status = us->iobuf; us 1406 drivers/usb/storage/shuttle_usbat.c if (usbat_write(us, USBAT_ATA, USBAT_ATA_DEVICE, selector) != us 1410 drivers/usb/storage/shuttle_usbat.c if (usbat_read(us, USBAT_ATA, USBAT_ATA_STATUS, status) != us 1414 drivers/usb/storage/shuttle_usbat.c if (usbat_read(us, USBAT_ATA, USBAT_ATA_DEVICE, status) != us 1418 drivers/usb/storage/shuttle_usbat.c if (usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_ME, status) != us 1422 drivers/usb/storage/shuttle_usbat.c if (usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_HI, status) != us 1426 drivers/usb/storage/shuttle_usbat.c if (usbat_write(us, USBAT_ATA, USBAT_ATA_LBA_ME, 0x55) != us 1430 drivers/usb/storage/shuttle_usbat.c if (usbat_write(us, USBAT_ATA, USBAT_ATA_LBA_HI, 0xAA) != us 1434 drivers/usb/storage/shuttle_usbat.c if (usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_ME, status) != us 1438 drivers/usb/storage/shuttle_usbat.c if (usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_ME, status) != us 1449 drivers/usb/storage/shuttle_usbat.c static int init_usbat(struct us_data *us, int devicetype) us 1455 drivers/usb/storage/shuttle_usbat.c unsigned char *status = us->iobuf; us 1457 drivers/usb/storage/shuttle_usbat.c us->extra = kzalloc(sizeof(struct usbat_info), GFP_NOIO); us 1458 drivers/usb/storage/shuttle_usbat.c if (!us->extra) us 1461 drivers/usb/storage/shuttle_usbat.c info = (struct usbat_info *) (us->extra); us 1464 drivers/usb/storage/shuttle_usbat.c rc = usbat_write_user_io(us, us 1470 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 1\n"); us 1474 drivers/usb/storage/shuttle_usbat.c rc = usbat_read_user_io(us, status); us 1478 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 2\n"); us 1480 drivers/usb/storage/shuttle_usbat.c rc = usbat_read_user_io(us, status); us 1484 drivers/usb/storage/shuttle_usbat.c rc = usbat_read_user_io(us, status); us 1488 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 3\n"); us 1490 drivers/usb/storage/shuttle_usbat.c rc = usbat_select_and_test_registers(us); us 1494 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 4\n"); us 1496 drivers/usb/storage/shuttle_usbat.c rc = usbat_read_user_io(us, status); us 1500 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 5\n"); us 1503 drivers/usb/storage/shuttle_usbat.c rc = usbat_device_enable_cdt(us); us 1507 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 6\n"); us 1509 drivers/usb/storage/shuttle_usbat.c rc = usbat_read_user_io(us, status); us 1513 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 7\n"); us 1517 drivers/usb/storage/shuttle_usbat.c rc = usbat_read_user_io(us, status); us 1521 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 8\n"); us 1523 drivers/usb/storage/shuttle_usbat.c rc = usbat_select_and_test_registers(us); us 1527 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 9\n"); us 1530 drivers/usb/storage/shuttle_usbat.c if (usbat_set_transport(us, info, devicetype)) us 1533 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 10\n"); us 1535 drivers/usb/storage/shuttle_usbat.c if (usbat_get_device_type(us) == USBAT_DEV_FLASH) { us 1539 drivers/usb/storage/shuttle_usbat.c rc = usbat_set_shuttle_features(us, (USBAT_FEAT_ETEN | USBAT_FEAT_ET2 | USBAT_FEAT_ET1), us 1544 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INIT 11\n"); us 1552 drivers/usb/storage/shuttle_usbat.c static int usbat_hp8200e_transport(struct scsi_cmnd *srb, struct us_data *us) us 1555 drivers/usb/storage/shuttle_usbat.c unsigned char *status = us->iobuf; us 1589 drivers/usb/storage/shuttle_usbat.c result = usbat_get_status(us, status); us 1590 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Status = %02X\n", *status); us 1598 drivers/usb/storage/shuttle_usbat.c result = usbat_hp8200e_rw_block_test(us, USBAT_ATA, us 1608 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Wrote %08X bytes\n", transferred); us 1616 drivers/usb/storage/shuttle_usbat.c return usbat_hp8200e_handle_read10(us, registers, data, srb); us 1621 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Error: len = %08X... what do I do now?\n", us 1626 drivers/usb/storage/shuttle_usbat.c result = usbat_multiple_write(us, registers, data, 7); us 1641 drivers/usb/storage/shuttle_usbat.c result = usbat_write_block(us, USBAT_ATA, srb->cmnd, 12, us 1653 drivers/usb/storage/shuttle_usbat.c if (usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_ME, status) != us 1660 drivers/usb/storage/shuttle_usbat.c if (usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_HI, status) != us 1670 drivers/usb/storage/shuttle_usbat.c result = usbat_read_block(us, scsi_sglist(srb), len, us 1680 drivers/usb/storage/shuttle_usbat.c static int usbat_flash_transport(struct scsi_cmnd * srb, struct us_data *us) us 1683 drivers/usb/storage/shuttle_usbat.c struct usbat_info *info = (struct usbat_info *) (us->extra); us 1685 drivers/usb/storage/shuttle_usbat.c unsigned char *ptr = us->iobuf; us 1691 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "INQUIRY - Returning bogus response\n"); us 1693 drivers/usb/storage/shuttle_usbat.c fill_inquiry_response(us, ptr, 36); us 1698 drivers/usb/storage/shuttle_usbat.c rc = usbat_flash_check_media(us, info); us 1702 drivers/usb/storage/shuttle_usbat.c rc = usbat_flash_get_sector_count(us, info); us 1708 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "READ_CAPACITY: %ld sectors, %ld bytes per sector\n", us 1724 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Gah! MODE_SELECT_10\n"); us 1734 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "READ_10: read block 0x%04lx count %ld\n", us 1736 drivers/usb/storage/shuttle_usbat.c return usbat_flash_read_data(us, info, block, blocks); us 1749 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "READ_12: read block 0x%04lx count %ld\n", us 1751 drivers/usb/storage/shuttle_usbat.c return usbat_flash_read_data(us, info, block, blocks); us 1760 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "WRITE_10: write block 0x%04lx count %ld\n", us 1762 drivers/usb/storage/shuttle_usbat.c return usbat_flash_write_data(us, info, block, blocks); us 1775 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "WRITE_12: write block 0x%04lx count %ld\n", us 1777 drivers/usb/storage/shuttle_usbat.c return usbat_flash_write_data(us, info, block, blocks); us 1782 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "TEST_UNIT_READY\n"); us 1784 drivers/usb/storage/shuttle_usbat.c rc = usbat_flash_check_media(us, info); us 1788 drivers/usb/storage/shuttle_usbat.c return usbat_check_status(us); us 1792 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "REQUEST_SENSE\n"); us 1813 drivers/usb/storage/shuttle_usbat.c usb_stor_dbg(us, "Gah! Unknown command: %d (0x%x)\n", us 1821 drivers/usb/storage/shuttle_usbat.c static int init_usbat_cd(struct us_data *us) us 1823 drivers/usb/storage/shuttle_usbat.c return init_usbat(us, USBAT_DEV_HP8200); us 1826 drivers/usb/storage/shuttle_usbat.c static int init_usbat_flash(struct us_data *us) us 1828 drivers/usb/storage/shuttle_usbat.c return init_usbat(us, USBAT_DEV_FLASH); us 1836 drivers/usb/storage/shuttle_usbat.c struct us_data *us; us 1839 drivers/usb/storage/shuttle_usbat.c result = usb_stor_probe1(&us, intf, id, us 1849 drivers/usb/storage/shuttle_usbat.c us->transport_name = "Shuttle USBAT"; us 1850 drivers/usb/storage/shuttle_usbat.c us->transport = usbat_flash_transport; us 1851 drivers/usb/storage/shuttle_usbat.c us->transport_reset = usb_stor_CB_reset; us 1852 drivers/usb/storage/shuttle_usbat.c us->max_lun = 0; us 1854 drivers/usb/storage/shuttle_usbat.c result = usb_stor_probe2(us); us 127 drivers/usb/storage/sierra_ms.c int sierra_ms_init(struct us_data *us) us 136 drivers/usb/storage/sierra_ms.c udev = us->pusb_dev; us 138 drivers/usb/storage/sierra_ms.c sh = us_to_host(us); us 143 drivers/usb/storage/sierra_ms.c usb_stor_dbg(us, "SWIMS: Forcing Modem Mode\n"); us 146 drivers/usb/storage/sierra_ms.c usb_stor_dbg(us, "SWIMS: Failed to switch to modem mode\n"); us 151 drivers/usb/storage/sierra_ms.c usb_stor_dbg(us, "SWIMS: Forcing Mass Storage Mode\n"); us 156 drivers/usb/storage/sierra_ms.c usb_stor_dbg(us, "SWIMS: Normal SWoC Logic\n"); us 168 drivers/usb/storage/sierra_ms.c usb_stor_dbg(us, "SWIMS: Failed SWoC query\n"); us 174 drivers/usb/storage/sierra_ms.c usb_stor_dbg(us, "SWIMS: Completely failed SWoC query\n"); us 179 drivers/usb/storage/sierra_ms.c debug_swoc(&us->pusb_dev->dev, swocInfo); us 186 drivers/usb/storage/sierra_ms.c usb_stor_dbg(us, "SWIMS: Switching to Modem Mode\n"); us 190 drivers/usb/storage/sierra_ms.c usb_stor_dbg(us, "SWIMS: Failed to switch modem\n"); us 197 drivers/usb/storage/sierra_ms.c return device_create_file(&us->pusb_intf->dev, &dev_attr_truinst); us 4 drivers/usb/storage/sierra_ms.h extern int sierra_ms_init(struct us_data *us); us 115 drivers/usb/storage/transport.c static int usb_stor_msg_common(struct us_data *us, int timeout) us 122 drivers/usb/storage/transport.c if (test_bit(US_FLIDX_ABORTING, &us->dflags)) us 129 drivers/usb/storage/transport.c us->current_urb->context = &urb_done; us 130 drivers/usb/storage/transport.c us->current_urb->transfer_flags = 0; us 138 drivers/usb/storage/transport.c if (us->current_urb->transfer_buffer == us->iobuf) us 139 drivers/usb/storage/transport.c us->current_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; us 140 drivers/usb/storage/transport.c us->current_urb->transfer_dma = us->iobuf_dma; us 143 drivers/usb/storage/transport.c status = usb_submit_urb(us->current_urb, GFP_NOIO); us 153 drivers/usb/storage/transport.c set_bit(US_FLIDX_URB_ACTIVE, &us->dflags); us 156 drivers/usb/storage/transport.c if (test_bit(US_FLIDX_ABORTING, &us->dflags)) { us 159 drivers/usb/storage/transport.c if (test_and_clear_bit(US_FLIDX_URB_ACTIVE, &us->dflags)) { us 160 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- cancelling URB\n"); us 161 drivers/usb/storage/transport.c usb_unlink_urb(us->current_urb); us 169 drivers/usb/storage/transport.c clear_bit(US_FLIDX_URB_ACTIVE, &us->dflags); us 172 drivers/usb/storage/transport.c usb_stor_dbg(us, "%s -- cancelling URB\n", us 174 drivers/usb/storage/transport.c usb_kill_urb(us->current_urb); us 178 drivers/usb/storage/transport.c return us->current_urb->status; us 185 drivers/usb/storage/transport.c int usb_stor_control_msg(struct us_data *us, unsigned int pipe, us 191 drivers/usb/storage/transport.c usb_stor_dbg(us, "rq=%02x rqtype=%02x value=%04x index=%02x len=%u\n", us 195 drivers/usb/storage/transport.c us->cr->bRequestType = requesttype; us 196 drivers/usb/storage/transport.c us->cr->bRequest = request; us 197 drivers/usb/storage/transport.c us->cr->wValue = cpu_to_le16(value); us 198 drivers/usb/storage/transport.c us->cr->wIndex = cpu_to_le16(index); us 199 drivers/usb/storage/transport.c us->cr->wLength = cpu_to_le16(size); us 202 drivers/usb/storage/transport.c usb_fill_control_urb(us->current_urb, us->pusb_dev, pipe, us 203 drivers/usb/storage/transport.c (unsigned char*) us->cr, data, size, us 205 drivers/usb/storage/transport.c status = usb_stor_msg_common(us, timeout); us 209 drivers/usb/storage/transport.c status = us->current_urb->actual_length; us 227 drivers/usb/storage/transport.c int usb_stor_clear_halt(struct us_data *us, unsigned int pipe) us 235 drivers/usb/storage/transport.c result = usb_stor_control_msg(us, us->send_ctrl_pipe, us 241 drivers/usb/storage/transport.c usb_reset_endpoint(us->pusb_dev, endp); us 243 drivers/usb/storage/transport.c usb_stor_dbg(us, "result = %d\n", result); us 256 drivers/usb/storage/transport.c static int interpret_urb_result(struct us_data *us, unsigned int pipe, us 259 drivers/usb/storage/transport.c usb_stor_dbg(us, "Status code %d; transferred %u/%u\n", us 266 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- short transfer\n"); us 270 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- transfer complete\n"); us 280 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- stall on control pipe\n"); us 285 drivers/usb/storage/transport.c usb_stor_dbg(us, "clearing endpoint halt for pipe 0x%x\n", us 287 drivers/usb/storage/transport.c if (usb_stor_clear_halt(us, pipe) < 0) us 293 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- babble\n"); us 298 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- transfer cancelled\n"); us 303 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- short read transfer\n"); us 308 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- abort or disconnect in progress\n"); us 313 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- unknown error\n"); us 322 drivers/usb/storage/transport.c int usb_stor_ctrl_transfer(struct us_data *us, unsigned int pipe, us 328 drivers/usb/storage/transport.c usb_stor_dbg(us, "rq=%02x rqtype=%02x value=%04x index=%02x len=%u\n", us 332 drivers/usb/storage/transport.c us->cr->bRequestType = requesttype; us 333 drivers/usb/storage/transport.c us->cr->bRequest = request; us 334 drivers/usb/storage/transport.c us->cr->wValue = cpu_to_le16(value); us 335 drivers/usb/storage/transport.c us->cr->wIndex = cpu_to_le16(index); us 336 drivers/usb/storage/transport.c us->cr->wLength = cpu_to_le16(size); us 339 drivers/usb/storage/transport.c usb_fill_control_urb(us->current_urb, us->pusb_dev, pipe, us 340 drivers/usb/storage/transport.c (unsigned char*) us->cr, data, size, us 342 drivers/usb/storage/transport.c result = usb_stor_msg_common(us, 0); us 344 drivers/usb/storage/transport.c return interpret_urb_result(us, pipe, size, result, us 345 drivers/usb/storage/transport.c us->current_urb->actual_length); us 356 drivers/usb/storage/transport.c static int usb_stor_intr_transfer(struct us_data *us, void *buf, us 360 drivers/usb/storage/transport.c unsigned int pipe = us->recv_intr_pipe; us 363 drivers/usb/storage/transport.c usb_stor_dbg(us, "xfer %u bytes\n", length); us 366 drivers/usb/storage/transport.c maxp = usb_maxpacket(us->pusb_dev, pipe, usb_pipeout(pipe)); us 371 drivers/usb/storage/transport.c usb_fill_int_urb(us->current_urb, us->pusb_dev, pipe, buf, us 373 drivers/usb/storage/transport.c us->ep_bInterval); us 374 drivers/usb/storage/transport.c result = usb_stor_msg_common(us, 0); us 376 drivers/usb/storage/transport.c return interpret_urb_result(us, pipe, length, result, us 377 drivers/usb/storage/transport.c us->current_urb->actual_length); us 385 drivers/usb/storage/transport.c int usb_stor_bulk_transfer_buf(struct us_data *us, unsigned int pipe, us 390 drivers/usb/storage/transport.c usb_stor_dbg(us, "xfer %u bytes\n", length); us 393 drivers/usb/storage/transport.c usb_fill_bulk_urb(us->current_urb, us->pusb_dev, pipe, buf, length, us 395 drivers/usb/storage/transport.c result = usb_stor_msg_common(us, 0); us 399 drivers/usb/storage/transport.c *act_len = us->current_urb->actual_length; us 400 drivers/usb/storage/transport.c return interpret_urb_result(us, pipe, length, result, us 401 drivers/usb/storage/transport.c us->current_urb->actual_length); us 411 drivers/usb/storage/transport.c static int usb_stor_bulk_transfer_sglist(struct us_data *us, unsigned int pipe, us 418 drivers/usb/storage/transport.c if (test_bit(US_FLIDX_ABORTING, &us->dflags)) us 422 drivers/usb/storage/transport.c usb_stor_dbg(us, "xfer %u bytes, %d entries\n", length, num_sg); us 423 drivers/usb/storage/transport.c result = usb_sg_init(&us->current_sg, us->pusb_dev, pipe, 0, us 426 drivers/usb/storage/transport.c usb_stor_dbg(us, "usb_sg_init returned %d\n", result); us 434 drivers/usb/storage/transport.c set_bit(US_FLIDX_SG_ACTIVE, &us->dflags); us 437 drivers/usb/storage/transport.c if (test_bit(US_FLIDX_ABORTING, &us->dflags)) { us 440 drivers/usb/storage/transport.c if (test_and_clear_bit(US_FLIDX_SG_ACTIVE, &us->dflags)) { us 441 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- cancelling sg request\n"); us 442 drivers/usb/storage/transport.c usb_sg_cancel(&us->current_sg); us 447 drivers/usb/storage/transport.c usb_sg_wait(&us->current_sg); us 448 drivers/usb/storage/transport.c clear_bit(US_FLIDX_SG_ACTIVE, &us->dflags); us 450 drivers/usb/storage/transport.c result = us->current_sg.status; us 452 drivers/usb/storage/transport.c *act_len = us->current_sg.bytes; us 453 drivers/usb/storage/transport.c return interpret_urb_result(us, pipe, length, result, us 454 drivers/usb/storage/transport.c us->current_sg.bytes); us 461 drivers/usb/storage/transport.c int usb_stor_bulk_srb(struct us_data* us, unsigned int pipe, us 465 drivers/usb/storage/transport.c int result = usb_stor_bulk_transfer_sglist(us, pipe, scsi_sglist(srb), us 483 drivers/usb/storage/transport.c int usb_stor_bulk_transfer_sg(struct us_data* us, unsigned int pipe, us 492 drivers/usb/storage/transport.c result = usb_stor_bulk_transfer_sglist(us, pipe, us 498 drivers/usb/storage/transport.c result = usb_stor_bulk_transfer_buf(us, pipe, buf, us 519 drivers/usb/storage/transport.c static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb) us 539 drivers/usb/storage/transport.c if (!us->use_last_sector_hacks) us 564 drivers/usb/storage/transport.c us->use_last_sector_hacks = 0; us 576 drivers/usb/storage/transport.c if (++us->last_sector_retries < 3) us 590 drivers/usb/storage/transport.c us->last_sector_retries = 0; us 599 drivers/usb/storage/transport.c void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) us 606 drivers/usb/storage/transport.c result = us->transport(srb, us); us 612 drivers/usb/storage/transport.c if (test_bit(US_FLIDX_TIMED_OUT, &us->dflags)) { us 613 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- command was aborted\n"); us 620 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- transport indicates error, resetting\n"); us 628 drivers/usb/storage/transport.c last_sector_hacks(us, srb); us 648 drivers/usb/storage/transport.c if ((us->protocol == USB_PR_CB || us->protocol == USB_PR_DPCM_USB) && us 650 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- CB transport device requiring auto-sense\n"); us 660 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- transport indicates command failure\n"); us 672 drivers/usb/storage/transport.c !(us->fflags & US_FL_SANE_SENSE) && us 673 drivers/usb/storage/transport.c !(us->fflags & US_FL_BAD_SENSE) && us 675 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- SAT supported, increasing auto-sense\n"); us 676 drivers/usb/storage/transport.c us->fflags |= US_FL_SANE_SENSE; us 689 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- unexpectedly short transfer\n"); us 702 drivers/usb/storage/transport.c if (us->fflags & US_FL_SANE_SENSE) us 705 drivers/usb/storage/transport.c usb_stor_dbg(us, "Issuing auto-REQUEST_SENSE\n"); us 710 drivers/usb/storage/transport.c if (us->subclass == USB_SC_RBC || us->subclass == USB_SC_SCSI || us 711 drivers/usb/storage/transport.c us->subclass == USB_SC_CYP_ATACB) us 718 drivers/usb/storage/transport.c temp_result = us->transport(us->srb, us); us 723 drivers/usb/storage/transport.c if (test_bit(US_FLIDX_TIMED_OUT, &us->dflags)) { us 724 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- auto-sense aborted\n"); us 729 drivers/usb/storage/transport.c us->fflags &= ~US_FL_SANE_SENSE; us 730 drivers/usb/storage/transport.c us->fflags |= US_FL_BAD_SENSE; us 743 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- auto-sense failure, retry small sense\n"); us 745 drivers/usb/storage/transport.c us->fflags &= ~US_FL_SANE_SENSE; us 746 drivers/usb/storage/transport.c us->fflags |= US_FL_BAD_SENSE; us 752 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- auto-sense failure\n"); us 760 drivers/usb/storage/transport.c if (!(us->fflags & US_FL_SCM_MULT_TARG)) us 771 drivers/usb/storage/transport.c !(us->fflags & US_FL_SANE_SENSE) && us 772 drivers/usb/storage/transport.c !(us->fflags & US_FL_BAD_SENSE) && us 774 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- SANE_SENSE support enabled\n"); us 775 drivers/usb/storage/transport.c us->fflags |= US_FL_SANE_SENSE; us 781 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- Sense data truncated to %i from %i\n", us 790 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- Result from auto-sense is %d\n", us 792 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- code: 0x%x, key: 0x%x, ASC: 0x%x, ASCQ: 0x%x\n", us 796 drivers/usb/storage/transport.c usb_stor_show_sense(us, sshdr.sense_key, sshdr.asc, sshdr.ascq); us 857 drivers/usb/storage/transport.c if (unlikely((us->fflags & US_FL_INITIAL_READ10) && us 860 drivers/usb/storage/transport.c set_bit(US_FLIDX_READ10_WORKED, &us->dflags); us 861 drivers/usb/storage/transport.c } else if (test_bit(US_FLIDX_READ10_WORKED, &us->dflags)) { us 862 drivers/usb/storage/transport.c clear_bit(US_FLIDX_READ10_WORKED, &us->dflags); us 863 drivers/usb/storage/transport.c set_bit(US_FLIDX_REDO_READ10, &us->dflags); us 871 drivers/usb/storage/transport.c if (test_bit(US_FLIDX_REDO_READ10, &us->dflags)) { us 872 drivers/usb/storage/transport.c clear_bit(US_FLIDX_REDO_READ10, &us->dflags); us 883 drivers/usb/storage/transport.c last_sector_hacks(us, srb); us 897 drivers/usb/storage/transport.c scsi_lock(us_to_host(us)); us 898 drivers/usb/storage/transport.c set_bit(US_FLIDX_RESETTING, &us->dflags); us 899 drivers/usb/storage/transport.c clear_bit(US_FLIDX_ABORTING, &us->dflags); us 900 drivers/usb/storage/transport.c scsi_unlock(us_to_host(us)); us 906 drivers/usb/storage/transport.c mutex_unlock(&us->dev_mutex); us 907 drivers/usb/storage/transport.c result = usb_stor_port_reset(us); us 908 drivers/usb/storage/transport.c mutex_lock(&us->dev_mutex); us 911 drivers/usb/storage/transport.c scsi_lock(us_to_host(us)); us 912 drivers/usb/storage/transport.c usb_stor_report_device_reset(us); us 913 drivers/usb/storage/transport.c scsi_unlock(us_to_host(us)); us 914 drivers/usb/storage/transport.c us->transport_reset(us); us 916 drivers/usb/storage/transport.c clear_bit(US_FLIDX_RESETTING, &us->dflags); us 917 drivers/usb/storage/transport.c last_sector_hacks(us, srb); us 921 drivers/usb/storage/transport.c void usb_stor_stop_transport(struct us_data *us) us 929 drivers/usb/storage/transport.c if (test_and_clear_bit(US_FLIDX_URB_ACTIVE, &us->dflags)) { us 930 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- cancelling URB\n"); us 931 drivers/usb/storage/transport.c usb_unlink_urb(us->current_urb); us 935 drivers/usb/storage/transport.c if (test_and_clear_bit(US_FLIDX_SG_ACTIVE, &us->dflags)) { us 936 drivers/usb/storage/transport.c usb_stor_dbg(us, "-- cancelling sg request\n"); us 937 drivers/usb/storage/transport.c usb_sg_cancel(&us->current_sg); us 945 drivers/usb/storage/transport.c int usb_stor_CB_transport(struct scsi_cmnd *srb, struct us_data *us) us 957 drivers/usb/storage/transport.c memcpy(us->iobuf, srb->cmnd, srb->cmd_len); us 958 drivers/usb/storage/transport.c result = usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, us 961 drivers/usb/storage/transport.c us->ifnum, us->iobuf, srb->cmd_len); us 964 drivers/usb/storage/transport.c usb_stor_dbg(us, "Call to usb_stor_ctrl_transfer() returned %d\n", us 981 drivers/usb/storage/transport.c us->recv_bulk_pipe : us->send_bulk_pipe; us 982 drivers/usb/storage/transport.c result = usb_stor_bulk_srb(us, pipe, srb); us 983 drivers/usb/storage/transport.c usb_stor_dbg(us, "CBI data stage result is 0x%x\n", result); us 998 drivers/usb/storage/transport.c if (us->protocol != USB_PR_CBI) us 1001 drivers/usb/storage/transport.c result = usb_stor_intr_transfer(us, us->iobuf, 2); us 1002 drivers/usb/storage/transport.c usb_stor_dbg(us, "Got interrupt data (0x%x, 0x%x)\n", us 1003 drivers/usb/storage/transport.c us->iobuf[0], us->iobuf[1]); us 1015 drivers/usb/storage/transport.c if (us->subclass == USB_SC_UFI) { us 1019 drivers/usb/storage/transport.c if (us->iobuf[0]) us 1031 drivers/usb/storage/transport.c if (us->iobuf[0]) { us 1032 drivers/usb/storage/transport.c usb_stor_dbg(us, "CBI IRQ data showed reserved bType 0x%x\n", us 1033 drivers/usb/storage/transport.c us->iobuf[0]); us 1039 drivers/usb/storage/transport.c switch (us->iobuf[1] & 0x0F) { us 1053 drivers/usb/storage/transport.c usb_stor_clear_halt(us, pipe); us 1063 drivers/usb/storage/transport.c int usb_stor_Bulk_max_lun(struct us_data *us) us 1068 drivers/usb/storage/transport.c us->iobuf[0] = 0; us 1069 drivers/usb/storage/transport.c result = usb_stor_control_msg(us, us->recv_ctrl_pipe, us 1073 drivers/usb/storage/transport.c 0, us->ifnum, us->iobuf, 1, 10*HZ); us 1075 drivers/usb/storage/transport.c usb_stor_dbg(us, "GetMaxLUN command result is %d, data is %d\n", us 1076 drivers/usb/storage/transport.c result, us->iobuf[0]); us 1084 drivers/usb/storage/transport.c if (us->iobuf[0] < 16) { us 1085 drivers/usb/storage/transport.c return us->iobuf[0]; us 1087 drivers/usb/storage/transport.c dev_info(&us->pusb_intf->dev, us 1089 drivers/usb/storage/transport.c us->iobuf[0]); us 1103 drivers/usb/storage/transport.c int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us) us 1105 drivers/usb/storage/transport.c struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; us 1106 drivers/usb/storage/transport.c struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) us->iobuf; us 1115 drivers/usb/storage/transport.c if (unlikely(us->fflags & US_FL_BULK32)) { us 1117 drivers/usb/storage/transport.c us->iobuf[31] = 0; us 1125 drivers/usb/storage/transport.c bcb->Tag = ++us->tag; us 1127 drivers/usb/storage/transport.c if (us->fflags & US_FL_SCM_MULT_TARG) us 1136 drivers/usb/storage/transport.c usb_stor_dbg(us, "Bulk Command S 0x%x T 0x%x L %d F %d Trg %d LUN %d CL %d\n", us 1141 drivers/usb/storage/transport.c result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, us 1143 drivers/usb/storage/transport.c usb_stor_dbg(us, "Bulk command transfer result=%d\n", result); us 1155 drivers/usb/storage/transport.c if (unlikely(us->fflags & US_FL_GO_SLOW)) us 1160 drivers/usb/storage/transport.c us->recv_bulk_pipe : us->send_bulk_pipe; us 1161 drivers/usb/storage/transport.c result = usb_stor_bulk_srb(us, pipe, srb); us 1162 drivers/usb/storage/transport.c usb_stor_dbg(us, "Bulk data transfer result 0x%x\n", result); us 1195 drivers/usb/storage/transport.c usb_stor_dbg(us, "Device skipped data phase\n"); us 1208 drivers/usb/storage/transport.c usb_stor_dbg(us, "Attempting to get CSW...\n"); us 1209 drivers/usb/storage/transport.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 1218 drivers/usb/storage/transport.c usb_stor_dbg(us, "Received 0-length CSW; retrying...\n"); us 1219 drivers/usb/storage/transport.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 1227 drivers/usb/storage/transport.c usb_stor_dbg(us, "Attempting to get CSW (2nd try)...\n"); us 1228 drivers/usb/storage/transport.c result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, us 1233 drivers/usb/storage/transport.c usb_stor_dbg(us, "Bulk status result = %d\n", result); us 1240 drivers/usb/storage/transport.c usb_stor_dbg(us, "Bulk Status S 0x%x T 0x%x R %u Stat 0x%x\n", us 1243 drivers/usb/storage/transport.c if (!(bcs->Tag == us->tag || (us->fflags & US_FL_BULK_IGNORE_TAG)) || us 1245 drivers/usb/storage/transport.c usb_stor_dbg(us, "Bulk logical error\n"); us 1254 drivers/usb/storage/transport.c if (!us->bcs_signature) { us 1255 drivers/usb/storage/transport.c us->bcs_signature = bcs->Signature; us 1256 drivers/usb/storage/transport.c if (us->bcs_signature != cpu_to_le32(US_BULK_CS_SIGN)) us 1257 drivers/usb/storage/transport.c usb_stor_dbg(us, "Learnt BCS signature 0x%08X\n", us 1258 drivers/usb/storage/transport.c le32_to_cpu(us->bcs_signature)); us 1259 drivers/usb/storage/transport.c } else if (bcs->Signature != us->bcs_signature) { us 1260 drivers/usb/storage/transport.c usb_stor_dbg(us, "Signature mismatch: got %08X, expecting %08X\n", us 1262 drivers/usb/storage/transport.c le32_to_cpu(us->bcs_signature)); us 1270 drivers/usb/storage/transport.c if (residue && !(us->fflags & US_FL_IGNORE_RESIDUE)) { us 1283 drivers/usb/storage/transport.c us->fflags |= US_FL_IGNORE_RESIDUE; us 1336 drivers/usb/storage/transport.c static int usb_stor_reset_common(struct us_data *us, us 1343 drivers/usb/storage/transport.c if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) { us 1344 drivers/usb/storage/transport.c usb_stor_dbg(us, "No reset during disconnect\n"); us 1348 drivers/usb/storage/transport.c result = usb_stor_control_msg(us, us->send_ctrl_pipe, us 1352 drivers/usb/storage/transport.c usb_stor_dbg(us, "Soft reset failed: %d\n", result); us 1360 drivers/usb/storage/transport.c wait_event_interruptible_timeout(us->delay_wait, us 1361 drivers/usb/storage/transport.c test_bit(US_FLIDX_DISCONNECTING, &us->dflags), us 1363 drivers/usb/storage/transport.c if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) { us 1364 drivers/usb/storage/transport.c usb_stor_dbg(us, "Reset interrupted by disconnect\n"); us 1368 drivers/usb/storage/transport.c usb_stor_dbg(us, "Soft reset: clearing bulk-in endpoint halt\n"); us 1369 drivers/usb/storage/transport.c result = usb_stor_clear_halt(us, us->recv_bulk_pipe); us 1371 drivers/usb/storage/transport.c usb_stor_dbg(us, "Soft reset: clearing bulk-out endpoint halt\n"); us 1372 drivers/usb/storage/transport.c result2 = usb_stor_clear_halt(us, us->send_bulk_pipe); us 1378 drivers/usb/storage/transport.c usb_stor_dbg(us, "Soft reset failed\n"); us 1380 drivers/usb/storage/transport.c usb_stor_dbg(us, "Soft reset done\n"); us 1387 drivers/usb/storage/transport.c int usb_stor_CB_reset(struct us_data *us) us 1389 drivers/usb/storage/transport.c memset(us->iobuf, 0xFF, CB_RESET_CMD_SIZE); us 1390 drivers/usb/storage/transport.c us->iobuf[0] = SEND_DIAGNOSTIC; us 1391 drivers/usb/storage/transport.c us->iobuf[1] = 4; us 1392 drivers/usb/storage/transport.c return usb_stor_reset_common(us, US_CBI_ADSC, us 1394 drivers/usb/storage/transport.c 0, us->ifnum, us->iobuf, CB_RESET_CMD_SIZE); us 1402 drivers/usb/storage/transport.c int usb_stor_Bulk_reset(struct us_data *us) us 1404 drivers/usb/storage/transport.c return usb_stor_reset_common(us, US_BULK_RESET_REQUEST, us 1406 drivers/usb/storage/transport.c 0, us->ifnum, NULL, 0); us 1414 drivers/usb/storage/transport.c int usb_stor_port_reset(struct us_data *us) us 1419 drivers/usb/storage/transport.c if (us->pusb_dev->quirks & USB_QUIRK_RESET) us 1422 drivers/usb/storage/transport.c result = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf); us 1424 drivers/usb/storage/transport.c usb_stor_dbg(us, "unable to lock device for reset: %d\n", us 1428 drivers/usb/storage/transport.c if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) { us 1430 drivers/usb/storage/transport.c usb_stor_dbg(us, "No reset during disconnect\n"); us 1432 drivers/usb/storage/transport.c result = usb_reset_device(us->pusb_dev); us 1433 drivers/usb/storage/transport.c usb_stor_dbg(us, "usb_reset_device returns %d\n", us 1436 drivers/usb/storage/transport.c usb_unlock_device(us->pusb_dev); us 72 drivers/usb/storage/transport.h extern int usb_stor_control_msg(struct us_data *us, unsigned int pipe, us 75 drivers/usb/storage/transport.h extern int usb_stor_clear_halt(struct us_data *us, unsigned int pipe); us 77 drivers/usb/storage/transport.h extern int usb_stor_ctrl_transfer(struct us_data *us, unsigned int pipe, us 80 drivers/usb/storage/transport.h extern int usb_stor_bulk_transfer_buf(struct us_data *us, unsigned int pipe, us 82 drivers/usb/storage/transport.h extern int usb_stor_bulk_transfer_sg(struct us_data *us, unsigned int pipe, us 84 drivers/usb/storage/transport.h extern int usb_stor_bulk_srb(struct us_data* us, unsigned int pipe, us 87 drivers/usb/storage/transport.h extern int usb_stor_port_reset(struct us_data *us); us 171 drivers/usb/storage/usb.c struct us_data *us = usb_get_intfdata(iface); us 174 drivers/usb/storage/usb.c mutex_lock(&us->dev_mutex); us 176 drivers/usb/storage/usb.c if (us->suspend_resume_hook) us 177 drivers/usb/storage/usb.c (us->suspend_resume_hook)(us, US_SUSPEND); us 184 drivers/usb/storage/usb.c mutex_unlock(&us->dev_mutex); us 191 drivers/usb/storage/usb.c struct us_data *us = usb_get_intfdata(iface); us 193 drivers/usb/storage/usb.c mutex_lock(&us->dev_mutex); us 195 drivers/usb/storage/usb.c if (us->suspend_resume_hook) us 196 drivers/usb/storage/usb.c (us->suspend_resume_hook)(us, US_RESUME); us 198 drivers/usb/storage/usb.c mutex_unlock(&us->dev_mutex); us 205 drivers/usb/storage/usb.c struct us_data *us = usb_get_intfdata(iface); us 208 drivers/usb/storage/usb.c usb_stor_report_bus_reset(us); us 227 drivers/usb/storage/usb.c struct us_data *us = usb_get_intfdata(iface); us 230 drivers/usb/storage/usb.c mutex_lock(&us->dev_mutex); us 237 drivers/usb/storage/usb.c struct us_data *us = usb_get_intfdata(iface); us 240 drivers/usb/storage/usb.c usb_stor_report_bus_reset(us); us 247 drivers/usb/storage/usb.c mutex_unlock(&us->dev_mutex); us 261 drivers/usb/storage/usb.c void fill_inquiry_response(struct us_data *us, unsigned char *data, us 280 drivers/usb/storage/usb.c u16 bcdDevice = le16_to_cpu(us->pusb_dev->descriptor.bcdDevice); us 283 drivers/usb/storage/usb.c n = strlen(us->unusual_dev->vendorName); us 284 drivers/usb/storage/usb.c memcpy(data+8, us->unusual_dev->vendorName, min(8, n)); us 285 drivers/usb/storage/usb.c n = strlen(us->unusual_dev->productName); us 286 drivers/usb/storage/usb.c memcpy(data+16, us->unusual_dev->productName, min(16, n)); us 294 drivers/usb/storage/usb.c usb_stor_set_xfer_buf(data, data_len, us->srb); us 300 drivers/usb/storage/usb.c struct us_data *us = (struct us_data *)__us; us 301 drivers/usb/storage/usb.c struct Scsi_Host *host = us_to_host(us); us 305 drivers/usb/storage/usb.c usb_stor_dbg(us, "*** thread sleeping\n"); us 306 drivers/usb/storage/usb.c if (wait_for_completion_interruptible(&us->cmnd_ready)) us 309 drivers/usb/storage/usb.c usb_stor_dbg(us, "*** thread awakened\n"); us 312 drivers/usb/storage/usb.c mutex_lock(&(us->dev_mutex)); us 318 drivers/usb/storage/usb.c srb = us->srb; us 321 drivers/usb/storage/usb.c mutex_unlock(&us->dev_mutex); us 322 drivers/usb/storage/usb.c usb_stor_dbg(us, "-- exiting\n"); us 327 drivers/usb/storage/usb.c if (test_bit(US_FLIDX_TIMED_OUT, &us->dflags)) { us 339 drivers/usb/storage/usb.c usb_stor_dbg(us, "UNKNOWN data direction\n"); us 348 drivers/usb/storage/usb.c !(us->fflags & US_FL_SCM_MULT_TARG)) { us 349 drivers/usb/storage/usb.c usb_stor_dbg(us, "Bad target number (%d:%llu)\n", us 355 drivers/usb/storage/usb.c else if (srb->device->lun > us->max_lun) { us 356 drivers/usb/storage/usb.c usb_stor_dbg(us, "Bad LUN (%d:%llu)\n", us 367 drivers/usb/storage/usb.c (us->fflags & US_FL_FIX_INQUIRY)) { us 372 drivers/usb/storage/usb.c usb_stor_dbg(us, "Faking INQUIRY command\n"); us 373 drivers/usb/storage/usb.c fill_inquiry_response(us, data_ptr, 36); us 379 drivers/usb/storage/usb.c US_DEBUG(usb_stor_show_command(us, srb)); us 380 drivers/usb/storage/usb.c us->proto_handler(srb, us); us 381 drivers/usb/storage/usb.c usb_mark_last_busy(us->pusb_dev); us 390 drivers/usb/storage/usb.c usb_stor_dbg(us, "scsi command aborted\n"); us 401 drivers/usb/storage/usb.c if (test_bit(US_FLIDX_TIMED_OUT, &us->dflags)) { us 402 drivers/usb/storage/usb.c complete(&(us->notify)); us 405 drivers/usb/storage/usb.c clear_bit(US_FLIDX_ABORTING, &us->dflags); us 406 drivers/usb/storage/usb.c clear_bit(US_FLIDX_TIMED_OUT, &us->dflags); us 410 drivers/usb/storage/usb.c us->srb = NULL; us 414 drivers/usb/storage/usb.c mutex_unlock(&us->dev_mutex); us 418 drivers/usb/storage/usb.c usb_stor_dbg(us, "scsi cmd done, result=0x%x\n", us 440 drivers/usb/storage/usb.c static int associate_dev(struct us_data *us, struct usb_interface *intf) us 443 drivers/usb/storage/usb.c us->pusb_dev = interface_to_usbdev(intf); us 444 drivers/usb/storage/usb.c us->pusb_intf = intf; us 445 drivers/usb/storage/usb.c us->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; us 446 drivers/usb/storage/usb.c usb_stor_dbg(us, "Vendor: 0x%04x, Product: 0x%04x, Revision: 0x%04x\n", us 447 drivers/usb/storage/usb.c le16_to_cpu(us->pusb_dev->descriptor.idVendor), us 448 drivers/usb/storage/usb.c le16_to_cpu(us->pusb_dev->descriptor.idProduct), us 449 drivers/usb/storage/usb.c le16_to_cpu(us->pusb_dev->descriptor.bcdDevice)); us 450 drivers/usb/storage/usb.c usb_stor_dbg(us, "Interface Subclass: 0x%02x, Protocol: 0x%02x\n", us 455 drivers/usb/storage/usb.c usb_set_intfdata(intf, us); us 458 drivers/usb/storage/usb.c us->cr = kmalloc(sizeof(*us->cr), GFP_KERNEL); us 459 drivers/usb/storage/usb.c if (!us->cr) us 462 drivers/usb/storage/usb.c us->iobuf = usb_alloc_coherent(us->pusb_dev, US_IOBUF_SIZE, us 463 drivers/usb/storage/usb.c GFP_KERNEL, &us->iobuf_dma); us 464 drivers/usb/storage/usb.c if (!us->iobuf) { us 465 drivers/usb/storage/usb.c usb_stor_dbg(us, "I/O buffer allocation failed\n"); us 585 drivers/usb/storage/usb.c static int get_device_info(struct us_data *us, const struct usb_device_id *id, us 588 drivers/usb/storage/usb.c struct usb_device *dev = us->pusb_dev; us 590 drivers/usb/storage/usb.c &us->pusb_intf->cur_altsetting->desc; us 591 drivers/usb/storage/usb.c struct device *pdev = &us->pusb_intf->dev; us 594 drivers/usb/storage/usb.c us->unusual_dev = unusual_dev; us 595 drivers/usb/storage/usb.c us->subclass = (unusual_dev->useProtocol == USB_SC_DEVICE) ? us 598 drivers/usb/storage/usb.c us->protocol = (unusual_dev->useTransport == USB_PR_DEVICE) ? us 601 drivers/usb/storage/usb.c us->fflags = id->driver_info; us 602 drivers/usb/storage/usb.c usb_stor_adjust_quirks(us->pusb_dev, &us->fflags); us 604 drivers/usb/storage/usb.c if (us->fflags & US_FL_IGNORE_DEVICE) { us 614 drivers/usb/storage/usb.c us->fflags &= ~US_FL_GO_SLOW; us 616 drivers/usb/storage/usb.c if (us->fflags) us 620 drivers/usb/storage/usb.c us->fflags); us 637 drivers/usb/storage/usb.c us->subclass == idesc->bInterfaceSubClass) us 640 drivers/usb/storage/usb.c us->protocol == idesc->bInterfaceProtocol) us 642 drivers/usb/storage/usb.c if (msg >= 0 && !(us->fflags & US_FL_NEED_OVERRIDE)) us 663 drivers/usb/storage/usb.c static void get_transport(struct us_data *us) us 665 drivers/usb/storage/usb.c switch (us->protocol) { us 667 drivers/usb/storage/usb.c us->transport_name = "Control/Bulk"; us 668 drivers/usb/storage/usb.c us->transport = usb_stor_CB_transport; us 669 drivers/usb/storage/usb.c us->transport_reset = usb_stor_CB_reset; us 670 drivers/usb/storage/usb.c us->max_lun = 7; us 674 drivers/usb/storage/usb.c us->transport_name = "Control/Bulk/Interrupt"; us 675 drivers/usb/storage/usb.c us->transport = usb_stor_CB_transport; us 676 drivers/usb/storage/usb.c us->transport_reset = usb_stor_CB_reset; us 677 drivers/usb/storage/usb.c us->max_lun = 7; us 681 drivers/usb/storage/usb.c us->transport_name = "Bulk"; us 682 drivers/usb/storage/usb.c us->transport = usb_stor_Bulk_transport; us 683 drivers/usb/storage/usb.c us->transport_reset = usb_stor_Bulk_reset; us 689 drivers/usb/storage/usb.c static void get_protocol(struct us_data *us) us 691 drivers/usb/storage/usb.c switch (us->subclass) { us 693 drivers/usb/storage/usb.c us->protocol_name = "Reduced Block Commands (RBC)"; us 694 drivers/usb/storage/usb.c us->proto_handler = usb_stor_transparent_scsi_command; us 698 drivers/usb/storage/usb.c us->protocol_name = "8020i"; us 699 drivers/usb/storage/usb.c us->proto_handler = usb_stor_pad12_command; us 700 drivers/usb/storage/usb.c us->max_lun = 0; us 704 drivers/usb/storage/usb.c us->protocol_name = "QIC-157"; us 705 drivers/usb/storage/usb.c us->proto_handler = usb_stor_pad12_command; us 706 drivers/usb/storage/usb.c us->max_lun = 0; us 710 drivers/usb/storage/usb.c us->protocol_name = "8070i"; us 711 drivers/usb/storage/usb.c us->proto_handler = usb_stor_pad12_command; us 712 drivers/usb/storage/usb.c us->max_lun = 0; us 716 drivers/usb/storage/usb.c us->protocol_name = "Transparent SCSI"; us 717 drivers/usb/storage/usb.c us->proto_handler = usb_stor_transparent_scsi_command; us 721 drivers/usb/storage/usb.c us->protocol_name = "Uniform Floppy Interface (UFI)"; us 722 drivers/usb/storage/usb.c us->proto_handler = usb_stor_ufi_command; us 728 drivers/usb/storage/usb.c static int get_pipes(struct us_data *us) us 730 drivers/usb/storage/usb.c struct usb_host_interface *alt = us->pusb_intf->cur_altsetting; us 744 drivers/usb/storage/usb.c usb_stor_dbg(us, "bulk endpoints not found\n"); us 749 drivers/usb/storage/usb.c if (res && us->protocol == USB_PR_CBI) { us 750 drivers/usb/storage/usb.c usb_stor_dbg(us, "interrupt endpoint not found\n"); us 755 drivers/usb/storage/usb.c us->send_ctrl_pipe = usb_sndctrlpipe(us->pusb_dev, 0); us 756 drivers/usb/storage/usb.c us->recv_ctrl_pipe = usb_rcvctrlpipe(us->pusb_dev, 0); us 757 drivers/usb/storage/usb.c us->send_bulk_pipe = usb_sndbulkpipe(us->pusb_dev, us 759 drivers/usb/storage/usb.c us->recv_bulk_pipe = usb_rcvbulkpipe(us->pusb_dev, us 762 drivers/usb/storage/usb.c us->recv_intr_pipe = usb_rcvintpipe(us->pusb_dev, us 764 drivers/usb/storage/usb.c us->ep_bInterval = ep_int->bInterval; us 770 drivers/usb/storage/usb.c static int usb_stor_acquire_resources(struct us_data *us) us 775 drivers/usb/storage/usb.c us->current_urb = usb_alloc_urb(0, GFP_KERNEL); us 776 drivers/usb/storage/usb.c if (!us->current_urb) us 783 drivers/usb/storage/usb.c if (us->unusual_dev->initFunction) { us 784 drivers/usb/storage/usb.c p = us->unusual_dev->initFunction(us); us 790 drivers/usb/storage/usb.c th = kthread_run(usb_stor_control_thread, us, "usb-storage"); us 792 drivers/usb/storage/usb.c dev_warn(&us->pusb_intf->dev, us 796 drivers/usb/storage/usb.c us->ctl_thread = th; us 802 drivers/usb/storage/usb.c static void usb_stor_release_resources(struct us_data *us) us 809 drivers/usb/storage/usb.c usb_stor_dbg(us, "-- sending exit command to thread\n"); us 810 drivers/usb/storage/usb.c complete(&us->cmnd_ready); us 811 drivers/usb/storage/usb.c if (us->ctl_thread) us 812 drivers/usb/storage/usb.c kthread_stop(us->ctl_thread); us 815 drivers/usb/storage/usb.c if (us->extra_destructor) { us 816 drivers/usb/storage/usb.c usb_stor_dbg(us, "-- calling extra_destructor()\n"); us 817 drivers/usb/storage/usb.c us->extra_destructor(us->extra); us 821 drivers/usb/storage/usb.c kfree(us->extra); us 822 drivers/usb/storage/usb.c usb_free_urb(us->current_urb); us 826 drivers/usb/storage/usb.c static void dissociate_dev(struct us_data *us) us 829 drivers/usb/storage/usb.c kfree(us->cr); us 830 drivers/usb/storage/usb.c usb_free_coherent(us->pusb_dev, US_IOBUF_SIZE, us->iobuf, us->iobuf_dma); us 833 drivers/usb/storage/usb.c usb_set_intfdata(us->pusb_intf, NULL); us 840 drivers/usb/storage/usb.c static void quiesce_and_remove_host(struct us_data *us) us 842 drivers/usb/storage/usb.c struct Scsi_Host *host = us_to_host(us); us 845 drivers/usb/storage/usb.c if (us->pusb_dev->state == USB_STATE_NOTATTACHED) { us 846 drivers/usb/storage/usb.c set_bit(US_FLIDX_DISCONNECTING, &us->dflags); us 847 drivers/usb/storage/usb.c wake_up(&us->delay_wait); us 854 drivers/usb/storage/usb.c cancel_delayed_work_sync(&us->scan_dwork); us 857 drivers/usb/storage/usb.c if (test_bit(US_FLIDX_SCAN_PENDING, &us->dflags)) us 858 drivers/usb/storage/usb.c usb_autopm_put_interface_no_suspend(us->pusb_intf); us 871 drivers/usb/storage/usb.c set_bit(US_FLIDX_DISCONNECTING, &us->dflags); us 873 drivers/usb/storage/usb.c wake_up(&us->delay_wait); us 877 drivers/usb/storage/usb.c static void release_everything(struct us_data *us) us 879 drivers/usb/storage/usb.c usb_stor_release_resources(us); us 880 drivers/usb/storage/usb.c dissociate_dev(us); us 886 drivers/usb/storage/usb.c scsi_host_put(us_to_host(us)); us 892 drivers/usb/storage/usb.c struct us_data *us = container_of(work, struct us_data, us 894 drivers/usb/storage/usb.c struct device *dev = &us->pusb_intf->dev; us 899 drivers/usb/storage/usb.c if (us->protocol == USB_PR_BULK && us 900 drivers/usb/storage/usb.c !(us->fflags & US_FL_SINGLE_LUN) && us 901 drivers/usb/storage/usb.c !(us->fflags & US_FL_SCM_MULT_TARG)) { us 902 drivers/usb/storage/usb.c mutex_lock(&us->dev_mutex); us 903 drivers/usb/storage/usb.c us->max_lun = usb_stor_Bulk_max_lun(us); us 909 drivers/usb/storage/usb.c if (us->max_lun >= 8) us 910 drivers/usb/storage/usb.c us_to_host(us)->max_lun = us->max_lun+1; us 911 drivers/usb/storage/usb.c mutex_unlock(&us->dev_mutex); us 913 drivers/usb/storage/usb.c scsi_scan_host(us_to_host(us)); us 918 drivers/usb/storage/usb.c usb_autopm_put_interface(us->pusb_intf); us 919 drivers/usb/storage/usb.c clear_bit(US_FLIDX_SCAN_PENDING, &us->dflags); us 940 drivers/usb/storage/usb.c struct us_data *us; us 949 drivers/usb/storage/usb.c host = scsi_host_alloc(sht, sizeof(*us)); us 960 drivers/usb/storage/usb.c *pus = us = host_to_us(host); us 961 drivers/usb/storage/usb.c mutex_init(&(us->dev_mutex)); us 962 drivers/usb/storage/usb.c us_set_lock_class(&us->dev_mutex, intf); us 963 drivers/usb/storage/usb.c init_completion(&us->cmnd_ready); us 964 drivers/usb/storage/usb.c init_completion(&(us->notify)); us 965 drivers/usb/storage/usb.c init_waitqueue_head(&us->delay_wait); us 966 drivers/usb/storage/usb.c INIT_DELAYED_WORK(&us->scan_dwork, usb_stor_scan_dwork); us 969 drivers/usb/storage/usb.c result = associate_dev(us, intf); us 974 drivers/usb/storage/usb.c result = get_device_info(us, id, unusual_dev); us 979 drivers/usb/storage/usb.c get_transport(us); us 980 drivers/usb/storage/usb.c get_protocol(us); us 989 drivers/usb/storage/usb.c usb_stor_dbg(us, "storage_probe() failed\n"); us 990 drivers/usb/storage/usb.c release_everything(us); us 996 drivers/usb/storage/usb.c int usb_stor_probe2(struct us_data *us) us 999 drivers/usb/storage/usb.c struct device *dev = &us->pusb_intf->dev; us 1002 drivers/usb/storage/usb.c if (!us->transport || !us->proto_handler) { us 1006 drivers/usb/storage/usb.c usb_stor_dbg(us, "Transport: %s\n", us->transport_name); us 1007 drivers/usb/storage/usb.c usb_stor_dbg(us, "Protocol: %s\n", us->protocol_name); us 1009 drivers/usb/storage/usb.c if (us->fflags & US_FL_SCM_MULT_TARG) { us 1014 drivers/usb/storage/usb.c us->max_lun = 7; us 1016 drivers/usb/storage/usb.c us_to_host(us)->this_id = 7; us 1020 drivers/usb/storage/usb.c us_to_host(us)->max_id = 1; us 1026 drivers/usb/storage/usb.c if (us->transport == usb_stor_Bulk_transport) us 1027 drivers/usb/storage/usb.c us_to_host(us)->no_scsi2_lun_in_cdb = 1; us 1031 drivers/usb/storage/usb.c if (us->fflags & US_FL_SINGLE_LUN) us 1032 drivers/usb/storage/usb.c us->max_lun = 0; us 1035 drivers/usb/storage/usb.c result = get_pipes(us); us 1043 drivers/usb/storage/usb.c if (us->fflags & US_FL_INITIAL_READ10) us 1044 drivers/usb/storage/usb.c set_bit(US_FLIDX_REDO_READ10, &us->dflags); us 1047 drivers/usb/storage/usb.c result = usb_stor_acquire_resources(us); us 1050 drivers/usb/storage/usb.c usb_autopm_get_interface_no_resume(us->pusb_intf); us 1051 drivers/usb/storage/usb.c snprintf(us->scsi_name, sizeof(us->scsi_name), "usb-storage %s", us 1052 drivers/usb/storage/usb.c dev_name(&us->pusb_intf->dev)); us 1053 drivers/usb/storage/usb.c result = scsi_add_host(us_to_host(us), dev); us 1061 drivers/usb/storage/usb.c set_bit(US_FLIDX_SCAN_PENDING, &us->dflags); us 1065 drivers/usb/storage/usb.c queue_delayed_work(system_freezable_wq, &us->scan_dwork, us 1071 drivers/usb/storage/usb.c usb_autopm_put_interface_no_suspend(us->pusb_intf); us 1073 drivers/usb/storage/usb.c usb_stor_dbg(us, "storage_probe() failed\n"); us 1074 drivers/usb/storage/usb.c release_everything(us); us 1082 drivers/usb/storage/usb.c struct us_data *us = usb_get_intfdata(intf); us 1084 drivers/usb/storage/usb.c quiesce_and_remove_host(us); us 1085 drivers/usb/storage/usb.c release_everything(us); us 1096 drivers/usb/storage/usb.c struct us_data *us; us 1131 drivers/usb/storage/usb.c result = usb_stor_probe1(&us, intf, id, unusual_dev, us 1138 drivers/usb/storage/usb.c result = usb_stor_probe2(us); us 153 drivers/usb/storage/usb.h static inline struct Scsi_Host *us_to_host(struct us_data *us) { us 154 drivers/usb/storage/usb.h return container_of((void *) us, struct Scsi_Host, hostdata); us 161 drivers/usb/storage/usb.h extern void fill_inquiry_response(struct us_data *us, us 190 drivers/usb/storage/usb.h extern int usb_stor_probe2(struct us_data *us); us 21 drivers/video/backlight/platform_lcd.c struct device *us; us 63 drivers/video/backlight/platform_lcd.c return plcd->us->parent == info->device; us 96 drivers/video/backlight/platform_lcd.c plcd->us = dev; us 498 drivers/video/fbdev/aty/mach64_ct.c FIXME: is it relevant for us? us 169 fs/dlm/debug_fs.c u64 us; us 177 fs/dlm/debug_fs.c us = ktime_to_us(ktime_sub(ktime_get(), lkb->lkb_timestamp)); us 193 fs/dlm/debug_fs.c (unsigned long long)us, us 1396 fs/dlm/lock.c s64 us; us 1414 fs/dlm/lock.c us = ktime_to_us(ktime_sub(ktime_get(), lkb->lkb_wait_time)); us 1416 fs/dlm/lock.c if (us < dlm_config.ci_waitwarn_us) us 1422 fs/dlm/lock.c if (us > debug_maxus) us 1423 fs/dlm/lock.c debug_maxus = us; us 1435 fs/dlm/lock.c "node %d", lkb->lkb_id, (long long)us, us 338 include/linux/mtd/cfi.h void cfi_udelay(int us); us 25 lib/zlib_inflate/inffast.c unsigned short us; us 38 lib/zlib_inflate/inffast.c return mm.us; us 293 lib/zlib_inflate/inffast.c mm.us = pat16; us 295 lib/zlib_inflate/inffast.c pat16 = mm.us; us 153 net/appletalk/aarp.c static void aarp_send_reply(struct net_device *dev, struct atalk_addr *us, us 182 net/appletalk/aarp.c eah->pa_src_net = us->s_net; us 183 net/appletalk/aarp.c eah->pa_src_node = us->s_node; us 203 net/appletalk/aarp.c static void aarp_send_probe(struct net_device *dev, struct atalk_addr *us) us 233 net/appletalk/aarp.c eah->pa_src_net = us->s_net; us 234 net/appletalk/aarp.c eah->pa_src_node = us->s_node; us 239 net/appletalk/aarp.c eah->pa_dst_net = us->s_net; us 240 net/appletalk/aarp.c eah->pa_dst_node = us->s_node; us 505 net/netfilter/xt_hashlimit.c u64 us = user; us 506 net/netfilter/xt_hashlimit.c us *= HZ * CREDITS_PER_JIFFY_BYTES; us 507 net/netfilter/xt_hashlimit.c return (u32) (us >> 32); us 87 net/qrtr/qrtr.c struct sockaddr_qrtr us; us 506 net/qrtr/qrtr.c int port = ipc->us.sq_port; us 516 net/qrtr/qrtr.c pkt->client.node = cpu_to_le32(ipc->us.sq_node); us 517 net/qrtr/qrtr.c pkt->client.port = cpu_to_le32(ipc->us.sq_port); us 520 net/qrtr/qrtr.c qrtr_bcast_enqueue(NULL, skb, QRTR_TYPE_DEL_CLIENT, &ipc->us, us 609 net/qrtr/qrtr.c if (!zapped && addr->sq_port == ipc->us.sq_port) us 620 net/qrtr/qrtr.c ipc->us.sq_port = port; us 658 net/qrtr/qrtr.c if (addr->sq_node != ipc->us.sq_node) us 772 net/qrtr/qrtr.c } else if (addr->sq_node == ipc->us.sq_node) { us 797 net/qrtr/qrtr.c if (ipc->us.sq_port == QRTR_PORT_CTRL) { us 809 net/qrtr/qrtr.c rc = enqueue_fn(node, skb, type, &ipc->us, addr); us 916 net/qrtr/qrtr.c qaddr = ipc->us; us 960 net/qrtr/qrtr.c *sq = ipc->us; us 1063 net/qrtr/qrtr.c ipc->us.sq_family = AF_QIPCRTR; us 1064 net/qrtr/qrtr.c ipc->us.sq_node = qrtr_local_nid; us 1065 net/qrtr/qrtr.c ipc->us.sq_port = 0; us 278 net/sched/sch_cake.c static u64 us_to_ns(u64 us) us 280 net/sched/sch_cake.c return us * NSEC_PER_USEC; us 549 net/sched/sch_hhf.c u32 us = nla_get_u32(tb[TCA_HHF_RESET_TIMEOUT]); us 551 net/sched/sch_hhf.c q->hhf_reset_timeout = usecs_to_jiffies(us); us 558 net/sched/sch_hhf.c u32 us = nla_get_u32(tb[TCA_HHF_EVICT_TIMEOUT]); us 560 net/sched/sch_hhf.c q->hhf_evict_timeout = usecs_to_jiffies(us); us 63 sound/isa/gus/gus_volume.c unsigned int us) us 76 sound/isa/gus/gus_volume.c us /= end - start; us 78 sound/isa/gus/gus_volume.c us /= start - end; us 84 sound/isa/gus/gus_volume.c if (us < value) { us 94 sound/isa/gus/gus_volume.c increment = (value + (value >> 1)) / us; us 45 sound/soc/codecs/tlv320dac33.c #define US_TO_SAMPLES(rate, us) \ us 46 sound/soc/codecs/tlv320dac33.c ((rate) / (1000000 / ((us) < 1000000 ? (us) : 1000000))) us 643 sound/usb/usx2y/usbusx2yaudio.c struct snd_usX2Y_urbSeq *us = NULL; us 648 sound/usb/usx2y/usbusx2yaudio.c us = kzalloc(sizeof(*us) + sizeof(struct urb*) * NOOF_SETRATE_URBS, GFP_KERNEL); us 649 sound/usb/usx2y/usbusx2yaudio.c if (NULL == us) { us 660 sound/usb/usx2y/usbusx2yaudio.c if (NULL == (us->urb[i] = usb_alloc_urb(0, GFP_KERNEL))) { us 666 sound/usb/usx2y/usbusx2yaudio.c usb_fill_bulk_urb(us->urb[i], usX2Y->dev, usb_sndbulkpipe(usX2Y->dev, 4), us 669 sound/usb/usx2y/usbusx2yaudio.c err = usb_urb_ep_type_check(us->urb[0]); us 672 sound/usb/usx2y/usbusx2yaudio.c us->submitted = 0; us 673 sound/usb/usx2y/usbusx2yaudio.c us->len = NOOF_SETRATE_URBS; us 674 sound/usb/usx2y/usbusx2yaudio.c usX2Y->US04 = us; us 675 sound/usb/usx2y/usbusx2yaudio.c wait_event_timeout(usX2Y->In04WaitQueue, 0 == us->len, HZ); us 677 sound/usb/usx2y/usbusx2yaudio.c if (us->len) us 680 sound/usb/usx2y/usbusx2yaudio.c if (us) { us 681 sound/usb/usx2y/usbusx2yaudio.c us->submitted = 2*NOOF_SETRATE_URBS; us 683 sound/usb/usx2y/usbusx2yaudio.c struct urb *urb = us->urb[i]; us 695 sound/usb/usx2y/usbusx2yaudio.c kfree(us);