Pete Zaitcev wrote: > Hi, guys: > > In the current libusual system, if a device is listed in unusual_devs.h, > it cannot be serviced by ub. Which is fine most of the time, because > listed devices are largely obscure. Unfortunately, iPod is listed too, > but I wish [to continue] to drive my iPod with ub. So, I would like to > have something like the attached patch.
First question - why run your iPod with ub - for speed improvements? Or... ? At one point wasn't ub slower? I haven't kept up with the status of ub. Tangential question - you're making the decision for the user here, so more so than "Why does Pete want to drive his iPod with ub", why does this make sense for everyone who uses Linux? > Architecturally, this is the best approach from those I tried. I can > pack everything into libsusual, but it makes the decision unclear > and there's a danger of making a device refused by either of storage > backends. With the explicit flag like below, things are much safer. > However, a certain uglification occurs... Comments on the patch inline. > /* sd.c special-cases sector size of 0 to mean 512. Needed? Safe? */ > - nsec = be32_to_cpu(*(__be32 *)p) + 1; > + nsec = be32_to_cpu(*(__be32 *)p); > + if (!(sc->us_flags & US_FL_FIX_CAPACITY)) > + nsec++; Can we reverse that logic, it's confusing. I would have done: nsec = be32_to_cpu(*(__be32 *)p) + 1; if (sc->us_flags & US_FL_FIX_CAPACITY) nsec--; That way you're defining the default and then adjusting for flags, not the other way around. > +#define UNUSUAL_DEV2(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \ > + vendorName, productName, useProtocol, useTransport, \ > + initFunction, flags, useType) \ > +{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin,bcdDeviceMax), \ > + .driver_info = (flags)|((useType)<<24) } UNUSUAL_DEV2?! Ew. How about UNUSUAL_DEV_UB? > +/* > + * Pete Zaitcev <[EMAIL PROTECTED]>, bz#164688. > + * The device blatantly ignores LUN and returns 1 in GetMaxLUN. > + */ > +UNUSUAL_DEV( 0x0c45, 0x1060, 0x0100, 0x0100, > + "Unknown", > + "Unknown", > + US_SC_DEVICE, US_PR_DEVICE, NULL, > + US_FL_SINGLE_LUN ), What device is this? Other than the above I'm OK with the patch. -- Phil Dibowitz [EMAIL PROTECTED] Freeware and Technical Pages Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/ "Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind." - Dr. Suess
signature.asc
Description: OpenPGP digital signature