~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal-proposed

« back to all changes in this revision

Viewing changes to drivers/usb/storage/ene_ub6250.c

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft, Andy Whitcroft
  • Date: 2012-06-21 09:16:38 UTC
  • Revision ID: package-import@ubuntu.com-20120621091638-gubhv4nox8xez1ct
Tags: 3.5.0-1.1
[ Andy Whitcroft]

* Rebuild lowlatency against Ubuntu-3.5.0-1.1
* All new configuration system to allow configuration deltas to be
  exposed via debian.lowlatency/config-delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
43
43
        .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
44
44
 
45
 
struct usb_device_id ene_ub6250_usb_ids[] = {
 
45
static struct usb_device_id ene_ub6250_usb_ids[] = {
46
46
#       include "unusual_ene_ub6250.h"
47
47
        { }             /* Terminating entry */
48
48
};
607
607
 
608
608
static int sd_scsi_read_capacity(struct us_data *us, struct scsi_cmnd *srb)
609
609
{
610
 
        u32   bl_num;
611
 
        u16    bl_len;
 
610
        u32     bl_num;
 
611
        u32     bl_len;
612
612
        unsigned int offset = 0;
613
613
        unsigned char    buf[8];
614
614
        struct scatterlist *sg = NULL;
622
622
                else
623
623
                        bl_num = (info->HC_C_SIZE + 1) * 1024 - 1;
624
624
        } else {
625
 
                bl_len = 1<<(info->SD_READ_BL_LEN);
 
625
                bl_len = 1 << (info->SD_READ_BL_LEN);
626
626
                bl_num = info->SD_Block_Mult * (info->SD_C_SIZE + 1)
627
627
                                * (1 << (info->SD_C_SIZE_MULT + 2)) - 1;
628
628
        }
674
674
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
675
675
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
676
676
        bcb->DataTransferLength = blenByte;
677
 
        bcb->Flags  = 0x80;
 
677
        bcb->Flags  = US_BULK_FLAG_IN;
678
678
        bcb->CDB[0] = 0xF1;
679
679
        bcb->CDB[5] = (unsigned char)(bnByte);
680
680
        bcb->CDB[4] = (unsigned char)(bnByte>>8);
777
777
        return 0;
778
778
}
779
779
 
780
 
int ms_lib_alloc_logicalmap(struct us_data *us)
 
780
static int ms_lib_alloc_logicalmap(struct us_data *us)
781
781
{
782
782
        u32  i;
783
783
        struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra;
858
858
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
859
859
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
860
860
        bcb->DataTransferLength = 0x200;
861
 
        bcb->Flags      = 0x80;
 
861
        bcb->Flags      = US_BULK_FLAG_IN;
862
862
        bcb->CDB[0]     = 0xF1;
863
863
 
864
864
        bcb->CDB[1]     = 0x02; /* in init.c ENE_MSInit() is 0x01 */
877
877
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
878
878
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
879
879
        bcb->DataTransferLength = 0x4;
880
 
        bcb->Flags      = 0x80;
 
880
        bcb->Flags      = US_BULK_FLAG_IN;
881
881
        bcb->CDB[0]     = 0xF1;
882
882
        bcb->CDB[1]     = 0x03;
883
883
 
1170
1170
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
1171
1171
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
1172
1172
        bcb->DataTransferLength = 0x200;
1173
 
        bcb->Flags = 0x80;
 
1173
        bcb->Flags = US_BULK_FLAG_IN;
1174
1174
        bcb->CDB[0] = 0xF2;
1175
1175
        bcb->CDB[1] = 0x06;
1176
1176
        bcb->CDB[4] = (unsigned char)(bn);
1249
1249
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
1250
1250
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
1251
1251
        bcb->DataTransferLength = 0x4;
1252
 
        bcb->Flags = 0x80;
 
1252
        bcb->Flags = US_BULK_FLAG_IN;
1253
1253
        bcb->CDB[0] = 0xF2;
1254
1254
        bcb->CDB[1] = 0x05;
1255
1255
        bcb->CDB[5] = (unsigned char)(PageNum);
1331
1331
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
1332
1332
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
1333
1333
        bcb->DataTransferLength = 0x4;
1334
 
        bcb->Flags      = 0x80;
 
1334
        bcb->Flags      = US_BULK_FLAG_IN;
1335
1335
        bcb->CDB[0]     = 0xF1;
1336
1336
        bcb->CDB[1]     = 0x03;
1337
1337
        bcb->CDB[5]     = (unsigned char)(PageNum);
1533
1533
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
1534
1534
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
1535
1535
        bcb->DataTransferLength = 0x4 * blen;
1536
 
        bcb->Flags      = 0x80;
 
1536
        bcb->Flags      = US_BULK_FLAG_IN;
1537
1537
        bcb->CDB[0]     = 0xF1;
1538
1538
        bcb->CDB[1]     = 0x03;
1539
1539
        bcb->CDB[5]     = (unsigned char)(PageNum);
1650
1650
                memset(bcb, 0, sizeof(struct bulk_cb_wrap));
1651
1651
                bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
1652
1652
                bcb->DataTransferLength = blenByte;
1653
 
                bcb->Flags  = 0x80;
 
1653
                bcb->Flags  = US_BULK_FLAG_IN;
1654
1654
                bcb->CDB[0] = 0xF1;
1655
1655
                bcb->CDB[1] = 0x02;
1656
1656
                bcb->CDB[5] = (unsigned char)(bn);
1694
1694
                        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
1695
1695
                        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
1696
1696
                        bcb->DataTransferLength = 0x200 * len;
1697
 
                        bcb->Flags  = 0x80;
 
1697
                        bcb->Flags  = US_BULK_FLAG_IN;
1698
1698
                        bcb->CDB[0] = 0xF1;
1699
1699
                        bcb->CDB[1] = 0x02;
1700
1700
                        bcb->CDB[5] = (unsigned char)(blkno);
1827
1827
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
1828
1828
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
1829
1829
        bcb->DataTransferLength = 0x01;
1830
 
        bcb->Flags                      = 0x80;
 
1830
        bcb->Flags                      = US_BULK_FLAG_IN;
1831
1831
        bcb->CDB[0]                     = 0xED;
1832
1832
        bcb->CDB[2]                     = (unsigned char)(index>>8);
1833
1833
        bcb->CDB[3]                     = (unsigned char)index;
1933
1933
        kfree(buf);
1934
1934
 
1935
1935
nofw:
1936
 
        if (sd_fw != NULL) {
1937
 
                release_firmware(sd_fw);
1938
 
                sd_fw = NULL;
1939
 
        }
1940
 
 
 
1936
        release_firmware(sd_fw);
1941
1937
        return result;
1942
1938
}
1943
1939
 
2083
2079
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
2084
2080
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
2085
2081
        bcb->DataTransferLength = 0x200;
2086
 
        bcb->Flags      = 0x80;
 
2082
        bcb->Flags      = US_BULK_FLAG_IN;
2087
2083
        bcb->CDB[0]     = 0xF1;
2088
2084
        bcb->CDB[1]     = 0x01;
2089
2085
 
2134
2130
 
2135
2131
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
2136
2132
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
2137
 
        bcb->Flags = 0x80;
 
2133
        bcb->Flags = US_BULK_FLAG_IN;
2138
2134
        bcb->CDB[0] = 0xF2;
2139
2135
 
2140
2136
        result = ene_send_scsi_cmd(us, FDIR_READ, NULL, 0);
2153
2149
        memset(bcb, 0, sizeof(struct bulk_cb_wrap));
2154
2150
        bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
2155
2151
        bcb->DataTransferLength = 0x200;
2156
 
        bcb->Flags              = 0x80;
 
2152
        bcb->Flags              = US_BULK_FLAG_IN;
2157
2153
        bcb->CDB[0]             = 0xF1;
2158
2154
 
2159
2155
        result = ene_send_scsi_cmd(us, FDIR_READ, &buf, 0);
2248
2244
/*
2249
2245
 * ms_scsi_irp()
2250
2246
 */
2251
 
int ms_scsi_irp(struct us_data *us, struct scsi_cmnd *srb)
 
2247
static int ms_scsi_irp(struct us_data *us, struct scsi_cmnd *srb)
2252
2248
{
2253
2249
        int result;
2254
2250
        struct ene_ub6250_info *info = (struct ene_ub6250_info *)us->extra;
2407
2403
        .post_reset =   usb_stor_post_reset,
2408
2404
        .id_table =     ene_ub6250_usb_ids,
2409
2405
        .soft_unbind =  1,
 
2406
        .no_dynamic_id = 1,
2410
2407
};
2411
2408
 
2412
 
static int __init ene_ub6250_init(void)
2413
 
{
2414
 
        return usb_register(&ene_ub6250_driver);
2415
 
}
2416
 
 
2417
 
static void __exit ene_ub6250_exit(void)
2418
 
{
2419
 
        usb_deregister(&ene_ub6250_driver);
2420
 
}
2421
 
 
2422
 
module_init(ene_ub6250_init);
2423
 
module_exit(ene_ub6250_exit);
 
2409
module_usb_driver(ene_ub6250_driver);