Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133524
b: refs/heads/master
c: 0d62939
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Mar 24, 2009
1 parent a0c9b32 commit 49cd665
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 43 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 26d6818f19d0ab018f28a20d699511c1efdf508b
refs/heads/master: 0d62939fab3cf28a23ac6934cec599793d3a1d9d
4 changes: 3 additions & 1 deletion trunk/drivers/usb/storage/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ config USB_STORAGE_DATAFAB
Datafab has a web page at <http://www.datafabusa.com/>.

config USB_STORAGE_FREECOM
bool "Freecom USB/ATAPI Bridge support"
tristate "Freecom USB/ATAPI Bridge support"
depends on USB_STORAGE
help
Support for the Freecom USB to IDE/ATAPI adaptor.
Freecom has a web page at <http://www.freecom.de/>.

If this driver is compiled as a module, it will be named ums-freecom.

config USB_STORAGE_ISD200
tristate "ISD-200 USB/ATA Bridge support"
depends on USB_STORAGE
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/usb/storage/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ EXTRA_CFLAGS := -Idrivers/scsi
obj-$(CONFIG_USB_STORAGE) += usb-storage.o

usb-storage-obj-$(CONFIG_USB_STORAGE_DEBUG) += debug.o
usb-storage-obj-$(CONFIG_USB_STORAGE_FREECOM) += freecom.o
usb-storage-obj-$(CONFIG_USB_STORAGE_DATAFAB) += datafab.o
usb-storage-obj-$(CONFIG_USB_STORAGE_JUMPSHOT) += jumpshot.o
usb-storage-obj-$(CONFIG_USB_STORAGE_ALAUDA) += alauda.o
Expand All @@ -27,12 +26,14 @@ else
endif

obj-$(CONFIG_USB_STORAGE_CYPRESS_ATACB) += ums-cypress.o
obj-$(CONFIG_USB_STORAGE_FREECOM) += ums-freecom.o
obj-$(CONFIG_USB_STORAGE_ISD200) += ums-isd200.o
obj-$(CONFIG_USB_STORAGE_SDDR09) += ums-sddr09.o
obj-$(CONFIG_USB_STORAGE_SDDR55) += ums-sddr55.o
obj-$(CONFIG_USB_STORAGE_USBAT) += ums-usbat.o

ums-cypress-objs := cypress_atacb.o
ums-freecom-objs := freecom.o
ums-isd200-objs := isd200.o
ums-sddr09-objs := sddr09.o
ums-sddr55-objs := sddr55.o
Expand Down
95 changes: 90 additions & 5 deletions trunk/drivers/usb/storage/freecom.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
* (http://www.freecom.de/)
*/

#include <linux/module.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>

#include "usb.h"
#include "transport.h"
#include "protocol.h"
#include "debug.h"
#include "freecom.h"

#ifdef CONFIG_USB_STORAGE_DEBUG
static void pdump (void *, int);
Expand Down Expand Up @@ -103,6 +103,47 @@ struct freecom_status {
#define FCM_PACKET_LENGTH 64
#define FCM_STATUS_PACKET_LENGTH 4

static int init_freecom(struct us_data *us);


/*
* The table of devices
*/
#define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
vendorName, productName, useProtocol, useTransport, \
initFunction, flags) \
{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
.driver_info = (flags)|(USB_US_TYPE_STOR<<24) }

struct usb_device_id freecom_usb_ids[] = {
# include "unusual_freecom.h"
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, freecom_usb_ids);

#undef UNUSUAL_DEV

/*
* The flags table
*/
#define UNUSUAL_DEV(idVendor, idProduct, bcdDeviceMin, bcdDeviceMax, \
vendor_name, product_name, use_protocol, use_transport, \
init_function, Flags) \
{ \
.vendorName = vendor_name, \
.productName = product_name, \
.useProtocol = use_protocol, \
.useTransport = use_transport, \
.initFunction = init_function, \
}

static struct us_unusual_dev freecom_unusual_dev_list[] = {
# include "unusual_freecom.h"
{ } /* Terminating entry */
};

#undef UNUSUAL_DEV

static int
freecom_readdata (struct scsi_cmnd *srb, struct us_data *us,
unsigned int ipipe, unsigned int opipe, int count)
Expand Down Expand Up @@ -173,7 +214,7 @@ freecom_writedata (struct scsi_cmnd *srb, struct us_data *us,
* Transport for the Freecom USB/IDE adaptor.
*
*/
int freecom_transport(struct scsi_cmnd *srb, struct us_data *us)
static int freecom_transport(struct scsi_cmnd *srb, struct us_data *us)
{
struct freecom_cb_wrap *fcb;
struct freecom_status *fst;
Expand Down Expand Up @@ -377,8 +418,7 @@ int freecom_transport(struct scsi_cmnd *srb, struct us_data *us)
return USB_STOR_TRANSPORT_GOOD;
}

int
freecom_init (struct us_data *us)
static int init_freecom(struct us_data *us)
{
int result;
char *buffer = us->iobuf;
Expand Down Expand Up @@ -417,7 +457,7 @@ freecom_init (struct us_data *us)
return USB_STOR_TRANSPORT_GOOD;
}

int usb_stor_freecom_reset(struct us_data *us)
static int usb_stor_freecom_reset(struct us_data *us)
{
printk (KERN_CRIT "freecom reset called\n");

Expand Down Expand Up @@ -479,3 +519,48 @@ static void pdump (void *ibuffer, int length)
}
#endif

static int freecom_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
struct us_data *us;
int result;

result = usb_stor_probe1(&us, intf, id,
(id - freecom_usb_ids) + freecom_unusual_dev_list);
if (result)
return result;

us->transport_name = "Freecom";
us->transport = freecom_transport;
us->transport_reset = usb_stor_freecom_reset;
us->max_lun = 0;

result = usb_stor_probe2(us);
return result;
}

static struct usb_driver freecom_driver = {
.name = "ums-freecom",
.probe = freecom_probe,
.disconnect = usb_stor_disconnect,
.suspend = usb_stor_suspend,
.resume = usb_stor_resume,
.reset_resume = usb_stor_reset_resume,
.pre_reset = usb_stor_pre_reset,
.post_reset = usb_stor_post_reset,
.id_table = freecom_usb_ids,
.soft_unbind = 1,
};

static int __init freecom_init(void)
{
return usb_register(&freecom_driver);
}

static void __exit freecom_exit(void)
{
usb_deregister(&freecom_driver);
}

module_init(freecom_init);
module_exit(freecom_exit);
7 changes: 0 additions & 7 deletions trunk/drivers/usb/storage/unusual_devs.h
Original file line number Diff line number Diff line change
Expand Up @@ -958,13 +958,6 @@ UNUSUAL_DEV( 0x0781, 0x0100, 0x0100, 0x0100,
US_SC_SCSI, US_PR_CB, NULL,
US_FL_SINGLE_LUN ),

#ifdef CONFIG_USB_STORAGE_FREECOM
UNUSUAL_DEV( 0x07ab, 0xfc01, 0x0000, 0x9999,
"Freecom",
"USB-IDE",
US_SC_QIC, US_PR_FREECOM, freecom_init, 0),
#endif

/* Reported by Eero Volotinen <eero@ping-viini.org> */
UNUSUAL_DEV( 0x07ab, 0xfccd, 0x0000, 0x9999,
"Freecom Technologies",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
/* Driver for Freecom USB/IDE adaptor
*
* Freecom v0.1:
*
* First release
*
* Current development and maintenance by:
* (c) 2000 David Brown <usb-storage@davidb.org>
*
* See freecom.c for more explanation
/* Unusual Devices File for the Freecom USB/IDE adaptor
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand All @@ -24,11 +15,12 @@
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef _FREECOM_USB_H
#define _FREECOM_USB_H
#if defined(CONFIG_USB_STORAGE_FREECOM) || \
defined(CONFIG_USB_STORAGE_FREECOM_MODULE)

extern int freecom_transport(struct scsi_cmnd *srb, struct us_data *us);
extern int usb_stor_freecom_reset(struct us_data *us);
extern int freecom_init (struct us_data *us);
UNUSUAL_DEV( 0x07ab, 0xfc01, 0x0000, 0x9999,
"Freecom",
"USB-IDE",
US_SC_QIC, US_PR_FREECOM, init_freecom, 0),

#endif
#endif /* defined(CONFIG_USB_STORAGE_FREECOM) || ... */
12 changes: 0 additions & 12 deletions trunk/drivers/usb/storage/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
#include "debug.h"
#include "initializers.h"

#ifdef CONFIG_USB_STORAGE_FREECOM
#include "freecom.h"
#endif
#ifdef CONFIG_USB_STORAGE_DATAFAB
#include "datafab.h"
#endif
Expand Down Expand Up @@ -607,15 +604,6 @@ static void get_transport(struct us_data *us)
us->transport_reset = usb_stor_Bulk_reset;
break;

#ifdef CONFIG_USB_STORAGE_FREECOM
case US_PR_FREECOM:
us->transport_name = "Freecom";
us->transport = freecom_transport;
us->transport_reset = usb_stor_freecom_reset;
us->max_lun = 0;
break;
#endif

#ifdef CONFIG_USB_STORAGE_DATAFAB
case US_PR_DATAFAB:
us->transport_name = "Datafab Bulk-Only";
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/storage/usual-tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct ignore_entry {

static struct ignore_entry ignore_ids[] = {
# include "unusual_cypress.h"
# include "unusual_freecom.h"
# include "unusual_isd200.h"
# include "unusual_sddr09.h"
# include "unusual_sddr55.h"
Expand Down

0 comments on commit 49cd665

Please sign in to comment.