svn commit: r225467 - in head/usr.sbin: bsdinstall/scripts pc-sysinstall/backend

2011-09-10 Thread Christian Brueffer
Author: brueffer
Date: Sat Sep 10 09:40:00 2011
New Revision: 225467
URL: http://svn.freebsd.org/changeset/base/225467

Log:
  Add ftp4.se.freebsd.org to the IPv4 and IPv6 mirror lists.
  
  PR:   157210, 157211
  Submitted by: Niclas Zeising zeis...@lysator.liu.se
  Approved by:  re (kib)

Modified:
  head/usr.sbin/bsdinstall/scripts/mirrorselect
  head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh

Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect
==
--- head/usr.sbin/bsdinstall/scripts/mirrorselect   Sat Sep 10 08:00:26 
2011(r225466)
+++ head/usr.sbin/bsdinstall/scripts/mirrorselect   Sat Sep 10 09:40:00 
2011(r225467)
@@ -45,6 +45,7 @@ MIRROR=`dialog --backtitle FreeBSD Inst
ftp://ftp3.ie.freebsd.org   IPv6 Ireland\
ftp://ftp.il.freebsd.orgIPv6 Israel\
ftp://ftp2.jp.freebsd.org   IPv6 Japan\
+   ftp://ftp4.se.freebsd.org   IPv6 Sweden\
ftp://ftp4.us.freebsd.org   IPv6 USA\
ftp://ftp2.tr.freebsd.org   IPv6 Turkey\
ftp://ftp1.freebsd.org  Primary\

Modified: head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh
==
--- head/usr.sbin/pc-sysinstall/backend/functions-ftp.shSat Sep 10 
08:00:26 2011(r225466)
+++ head/usr.sbin/pc-sysinstall/backend/functions-ftp.shSat Sep 10 
09:40:00 2011(r225467)
@@ -40,6 +40,7 @@ IPv6 Main Site: ftp.freebsd.org|\
 IPv6 Ireland: ftp3.ie.freebsd.org|\
 IPv6 Israel: ftp.il.freebsd.org|\
 IPv6 Japan: ftp2.jp.freebsd.org|\
+IPv6 Sweden: ftp4.se.freebsd.org|\
 IPv6 USA: ftp4.us.freebsd.org|\
 IPv6 Turkey: ftp2.tr.freebsd.org
 
@@ -212,6 +213,7 @@ SWEDEN_FTP_SERVERS=\
 Sweden: ftp.se.freebsd.org|\
 Sweden #2: ftp2.se.freebsd.org|\
 Sweden #3: ftp3.se.freebsd.org|\
+Sweden #4: ftp4.se.freebsd.org|\
 Sweden #5: ftp5.se.freebsd.org
 
 SWITZERLAND_FTP_SERVERS=\
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r225458 - in stable/8/sys: dev/usb dev/usb/quirk dev/usb/storage sys

2011-09-10 Thread Robert Watson

On Fri, 9 Sep 2011, Hans Petter Selasky wrote:


Log:
 MFC r225350 and r225400:

 This patch adds automatic detection of USB mass storage devices
 which does not support the no synchronize cache SCSI command.

 The __FreeBSD_version version macro has been bumped and
 external kernel modules needs to be recompiled after
 this patch.

 PR:usb/160299


For most other classes of hardware device driver framework KPIs -- especially 
things like PCI bus attachment, busdma, CAM, ifnet, and GEOM frameworks, our 
MFC rules would strictly disallow this sort of change, on the grounds that it 
is our KBI policy that we not break common classes of third-party device 
drivers (i.e., require them to be recompiled).  My suspicion is that we should 
be applying the same rules to the USB framework -- however, I don't know if we 
have any third-party USB device drivers?


(If we do, then this change should not have been MFC'd.)

Robert
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r225458 - in stable/8/sys: dev/usb dev/usb/quirk dev/usb/storage sys

2011-09-10 Thread Bjoern A. Zeeb

On Sep 10, 2011, at 10:54 AM, Robert Watson wrote:

 On Fri, 9 Sep 2011, Hans Petter Selasky wrote:
 
 Log:
 MFC r225350 and r225400:
 
 This patch adds automatic detection of USB mass storage devices
 which does not support the no synchronize cache SCSI command.
 
 The __FreeBSD_version version macro has been bumped and
 external kernel modules needs to be recompiled after
 this patch.
 
 PR:  usb/160299
 
 For most other classes of hardware device driver framework KPIs -- especially 
 things like PCI bus attachment, busdma, CAM, ifnet, and GEOM frameworks, our 
 MFC rules would strictly disallow this sort of change, on the grounds that it 
 is our KBI policy that we not break common classes of third-party device 
 drivers (i.e., require them to be recompiled).  My suspicion is that we 
 should be applying the same rules to the USB framework -- however, I don't 
 know if we have any third-party USB device drivers?
 
 (If we do, then this change should not have been MFC'd.)

We do have FreeBSD consumers with private USB drivers, yes.

/bz

-- 
Bjoern A. Zeeb You have to have visions!
 Stop bit received. Insert coin for new address family.

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r225458 - in stable/8/sys: dev/usb dev/usb/quirk dev/usb/storage sys

2011-09-10 Thread Hans Petter Selasky
On Saturday 10 September 2011 12:54:08 Robert Watson wrote:
 On Fri, 9 Sep 2011, Hans Petter Selasky wrote:
  Log:
   MFC r225350 and r225400:
   
   This patch adds automatic detection of USB mass storage devices
   which does not support the no synchronize cache SCSI command.
   
   The __FreeBSD_version version macro has been bumped and
   external kernel modules needs to be recompiled after
   this patch.
   
   PR:usb/160299
 
 For most other classes of hardware device driver framework KPIs --
 especially things like PCI bus attachment, busdma, CAM, ifnet, and GEOM
 frameworks, our MFC rules would strictly disallow this sort of change, on
 the grounds that it is our KBI policy that we not break common classes of
 third-party device drivers (i.e., require them to be recompiled).  My
 suspicion is that we should be applying the same rules to the USB
 framework -- however, I don't know if we have any third-party USB device
 drivers?
 
 (If we do, then this change should not have been MFC'd.)

Hi Robert,

I understand your point. The change is not breaking any KPIs towards 
userspace. The structure in question is only used within the kernel and kernel 
modules.

--HPS
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r225458 - in stable/8/sys: dev/usb dev/usb/quirk dev/usb/storage sys

2011-09-10 Thread Kostik Belousov
On Sat, Sep 10, 2011 at 11:21:00AM +, Bjoern A. Zeeb wrote:
 
 On Sep 10, 2011, at 10:54 AM, Robert Watson wrote:
 
  On Fri, 9 Sep 2011, Hans Petter Selasky wrote:
  
  Log:
  MFC r225350 and r225400:
  
  This patch adds automatic detection of USB mass storage devices
  which does not support the no synchronize cache SCSI command.
  
  The __FreeBSD_version version macro has been bumped and
  external kernel modules needs to be recompiled after
  this patch.
  
  PR:usb/160299
  
  For most other classes of hardware device driver framework KPIs -- 
  especially things like PCI bus attachment, busdma, CAM, ifnet, and GEOM 
  frameworks, our MFC rules would strictly disallow this sort of change, on 
  the grounds that it is our KBI policy that we not break common classes of 
  third-party device drivers (i.e., require them to be recompiled).  My 
  suspicion is that we should be applying the same rules to the USB framework 
  -- however, I don't know if we have any third-party USB device drivers?
  
  (If we do, then this change should not have been MFC'd.)
 
 We do have FreeBSD consumers with private USB drivers, yes.

It seems that most of the damage can be mitigated by placing the added
fields at the end of the structures, at least for stable/8.


pgpvvs3upGz2g.pgp
Description: PGP signature


Re: svn commit: r225458 - in stable/8/sys: dev/usb dev/usb/quirk dev/usb/storage sys

2011-09-10 Thread Robert N. M. Watson

On 10 Sep 2011, at 12:10, Hans Petter Selasky wrote:

 For most other classes of hardware device driver framework KPIs --
 especially things like PCI bus attachment, busdma, CAM, ifnet, and GEOM
 frameworks, our MFC rules would strictly disallow this sort of change, on
 the grounds that it is our KBI policy that we not break common classes of
 third-party device drivers (i.e., require them to be recompiled).  My
 suspicion is that we should be applying the same rules to the USB
 framework -- however, I don't know if we have any third-party USB device
 drivers?
 
 (If we do, then this change should not have been MFC'd.)
 
 I understand your point. The change is not breaking any KPIs towards 
 userspace. The structure in question is only used within the kernel and 
 kernel 
 modules.


Right -- exactly my point. If this change breaks third-party compiled USB 
device drivers, then our current approach to device driver KBIs does not allow 
it to be MFC'd in this form. Are there ways you can reformulate the change to 
avoid breaking those drivers? Sometimes this can be done by adding new symbols, 
rather than replacing currently symbols, although mileage varies.

Robert___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r225458 - in stable/8/sys: dev/usb dev/usb/quirk dev/usb/storage sys

2011-09-10 Thread Robert N. M. Watson

On 10 Sep 2011, at 12:35, Robert N. M. Watson wrote:

 I understand your point. The change is not breaking any KPIs towards 
 userspace. The structure in question is only used within the kernel and 
 kernel 
 modules.
 
 Right -- exactly my point. If this change breaks third-party compiled USB 
 device drivers, then our current approach to device driver KBIs does not 
 allow it to be MFC'd in this form. Are there ways you can reformulate the 
 change to avoid breaking those drivers? Sometimes this can be done by adding 
 new symbols, rather than replacing currently symbols, although mileage varies.

FYI, you can find our rules for modifications to many network stack data 
structures here:

  http://wiki.freebsd.org/NetKPIKBI

We're willing to make rather extensive changes to in-kernel data structures 
between major releases, but between minor releases we modify kernel structures 
frequently used by device drivers only according to specific rules.

Some are essentially immutable -- for example, struct mbuf, as assumptions 
about their size, layout, and interpretation are embedded in hundreds of kernel 
modules. Others, such as struct ipq, are only allocated by base kernel 
components, so you can safely extend them without breaking device drivers that 
incorporate earlier assumptions about layout (they just don't see new fields, 
which is often fine). Some contain explicit padding put in before the .0 
release to allow new features to be added subject to constrained rules -- for 
example, we often put additional padding fields into struct inpcb so that we 
can add new well-defined features after the release, but can't grow the 
structure due to it being embedded.

Over time, we've been trying to make the ABI/KBI more robust by...

(1) Attempting to divorce kernel data structures from user data structures as 
much as possible, allowing kernel data structures to be changed without 
requiring application modification.

(2) Attempting to document which data structures can change and in what ways 
(vis the above wiki page) so that there's a mutual understanding about what can 
be done.

(3) Think about what features will be added early in major release cycles -- 
hence announcements of a padding day earlier in the 9.0 cycle, and explicit 
commits to add necessary padding.

(4) Avoid embedding base kernel data structures within module data structures 
or allowing use of stack allocation of those structures. For example, 
historically, BSD device drivers would embed struct ifnet inside their 
per-drive softc. Now, the base kernel is responsible for allocating struct 
ifnet's, and per-driver softc's have a pointer to the ifnet allocated by the 
kernel. This adds more indirection in some cases, but can significantly improve 
robustness.

(5) In more extreme cases, disallow direct field access on data structures 
entirely, requiring modules to treat them as opaque and access fields via 
accessor functions. We don't use this approach all that much, but have (for 
example) used it in inpcb locking, as it allowed us to migrate from mutexes to 
rwlocks transparently, as well as change other aspects of locking strategy. We 
use this in the MAC Framework and a number of other places to achieve higher 
levels of abstraction that will allow us to change (for example) label 
allocation strategies between minor versions. Apple takes this much further 
than us: in XNU, all access to mbuf fields is done via accessor functions, 
allowing them to change the layout of mbufs without breaking device drivers 
(such that device drivers can work with multiple major Mac OS X versions). This 
presumably comes at a measurable cost that they deem appropriate given the 
specifics of their end-user requirements.

Another advantage to documenting KPIs/KBIs in a formal way is that it actually 
gives us more flexibility to break other interfaces -- they aren't on the list 
we advertise as being stable. We would benefit from doing a much better job at 
this, but have been trying to be more structured in the network stack, 
especially, due to a high demand for fundamental code changes in support of new 
features.

Robert___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Request for patch approval (Re: svn commit: r225458 - in stable/8/sys: dev/usb dev/usb/quirk dev/usb/storage sys)

2011-09-10 Thread Hans Petter Selasky

 Right -- exactly my point. If this change breaks third-party compiled USB
 device drivers, then our current approach to device driver KBIs does not
 allow it to be MFC'd in this form. Are there ways you can reformulate the
 change to avoid breaking those drivers? Sometimes this can be done by
 adding new symbols, rather than replacing currently symbols, although
 mileage varies.

Hi,

Here is my proposal:

Implement test for automatic quirks in function which has access to the USB 
device structure. This decouples the structure change in struct 
usbd_lookup_info.

The only structure which needs change is struct usb_device. In 9-current 
this structure will be kept as is. In 8-stable the new element will be moved 
to the end of the structure like suggested, and then there shouldn't be any 
problems.

Please find patches attached.

--HPS

Commit message:

Refactor auto-quirk solution so that we break as few external
drivers as possible.

PR: usb/160299
Approved by:re (kib)
Suggested by:   rwatson
MFC after:  0 days

Index: sys/dev/usb/usb_dynamic.h
===
--- sys/dev/usb/usb_dynamic.h	(revision 225458)
+++ sys/dev/usb/usb_dynamic.h	(working copy)
@@ -57,6 +57,5 @@
 void	usb_temp_unload(void *);
 void	usb_quirk_unload(void *);
 void	usb_bus_unload(void *);
-usb_test_quirk_t usb_test_quirk_w;
 
 #endif	/* _USB_DYNAMIC_H_ */
Index: sys/dev/usb/quirk/usb_quirk.c
===
--- sys/dev/usb/quirk/usb_quirk.c	(revision 225458)
+++ sys/dev/usb/quirk/usb_quirk.c	(working copy)
@@ -588,7 +588,7 @@
 	}
 	mtx_unlock(usb_quirk_mtx);
 done:
-	return (usb_test_quirk_w(info, quirk));
+	return (0);			/* no quirk match */
 }
 
 static struct usb_quirk_entry *
Index: sys/dev/usb/usbdi.h
===
--- sys/dev/usb/usbdi.h	(revision 225458)
+++ sys/dev/usb/usbdi.h	(working copy)
@@ -353,7 +353,6 @@
 	uint16_t idVendor;
 	uint16_t idProduct;
 	uint16_t bcdDevice;
-	uint16_t autoQuirk[USB_MAX_AUTO_QUIRK];
 	uint8_t	bDeviceClass;
 	uint8_t	bDeviceSubClass;
 	uint8_t	bDeviceProtocol;
Index: sys/dev/usb/usb_device.c
===
--- sys/dev/usb/usb_device.c	(revision 225458)
+++ sys/dev/usb/usb_device.c	(working copy)
@@ -1239,8 +1239,6 @@
 usb_init_attach_arg(struct usb_device *udev,
 struct usb_attach_arg *uaa)
 {
-	uint8_t x;
-
 	memset(uaa, 0, sizeof(*uaa));
 
 	uaa-device = udev;
@@ -1256,9 +1254,6 @@
 	uaa-info.bDeviceProtocol = udev-ddesc.bDeviceProtocol;
 	uaa-info.bConfigIndex = udev-curr_config_index;
 	uaa-info.bConfigNum = udev-curr_config_no;
-
-	for (x = 0; x != USB_MAX_AUTO_QUIRK; x++)
-		uaa-info.autoQuirk[x] = udev-autoQuirk[x];
 }
 
 /**
@@ -2389,8 +2384,22 @@
 usb_test_quirk(const struct usb_attach_arg *uaa, uint16_t quirk)
 {
 	uint8_t found;
+	uint8_t x;
 
+	if (quirk == UQ_NONE)
+		return (0);
+
+	/* search the automatic per device quirks first */
+
+	for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) {
+		if (uaa-device-autoQuirk[x] == quirk)
+			return (1);
+	}
+
+	/* search global quirk table, if any */
+
 	found = (usb_test_quirk_p) (uaa-info, quirk);
+
 	return (found);
 }
 
@@ -2798,7 +2807,8 @@
 	uint8_t x;
 
 	for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) {
-		if (udev-autoQuirk[x] == 0) {
+		if (udev-autoQuirk[x] == 0 ||
+		udev-autoQuirk[x] == quirk) {
 			udev-autoQuirk[x] = quirk;
 			return (0);	/* success */
 		}
Index: sys/dev/usb/usb_device.h
===
--- sys/dev/usb/usb_device.h	(revision 225458)
+++ sys/dev/usb/usb_device.h	(working copy)
@@ -149,7 +149,6 @@
 
 	uint16_t power;			/* mA the device uses */
 	uint16_t langid;		/* language for strings */
-	uint16_t autoQuirk[USB_MAX_AUTO_QUIRK];		/* dynamic quirks */
 
 	uint8_t	address;		/* device addess */
 	uint8_t	device_index;		/* device index in bus-devices */
@@ -191,6 +190,8 @@
 #endif
 
 	uint32_t clear_stall_errors;	/* number of clear-stall failures */
+
+	uint16_t autoQuirk[USB_MAX_AUTO_QUIRK];		/* dynamic quirks */
 };
 
 /* globals */
Index: sys/dev/usb/usb_dynamic.c
===
--- sys/dev/usb/usb_dynamic.c	(revision 225458)
+++ sys/dev/usb/usb_dynamic.c	(working copy)
@@ -50,12 +50,12 @@
 #include dev/usb/usb_process.h
 #include dev/usb/usb_device.h
 #include dev/usb/usb_dynamic.h
-#include dev/usb/quirk/usb_quirk.h
 
 /* function prototypes */
 static usb_handle_req_t usb_temp_get_desc_w;
 static usb_temp_setup_by_index_t usb_temp_setup_by_index_w;
 static usb_temp_unsetup_t usb_temp_unsetup_w;
+static usb_test_quirk_t usb_test_quirk_w;
 static usb_quirk_ioctl_t usb_quirk_ioctl_w;
 
 /* global variables */
@@ -72,19 +72,9 @@
 	return (USB_ERR_INVAL);
 }
 
-uint8_t
+static uint8_t
 

Re: Request for patch approval (Re: svn commit: r225458 - in stable/8/sys: dev/usb dev/usb/quirk dev/usb/storage sys)

2011-09-10 Thread Kostik Belousov
On Sat, Sep 10, 2011 at 03:40:16PM +0200, Hans Petter Selasky wrote:
 
  Right -- exactly my point. If this change breaks third-party compiled USB
  device drivers, then our current approach to device driver KBIs does not
  allow it to be MFC'd in this form. Are there ways you can reformulate the
  change to avoid breaking those drivers? Sometimes this can be done by
  adding new symbols, rather than replacing currently symbols, although
  mileage varies.
 
 Hi,
 
 Here is my proposal:
 
 Implement test for automatic quirks in function which has access to the USB 
 device structure. This decouples the structure change in struct 
 usbd_lookup_info.
 
 The only structure which needs change is struct usb_device. In 9-current 
 this structure will be kept as is. In 8-stable the new element will be moved 
 to the end of the structure like suggested, and then there shouldn't be any 
 problems.
 
 Please find patches attached.
 
 --HPS
 
 Commit message:
 
 Refactor auto-quirk solution so that we break as few external
 drivers as possible.
 
 PR: usb/160299
 Approved by:re (kib)
 Suggested by:   rwatson
 MFC after:  0 days
 
First, can you, please, regenerate the diff for stable/8 against the
code before r225458 ? I want to read diff to see ABI change, assuming
r225458 was not done at all.

Second, you cannot decrement __FreeBSD_version. In fact, you shall increment
it once more in the patch for stable/8.




pgpgHivdRGLaj.pgp
Description: PGP signature


Re: Request for patch approval (Re: svn commit: r225458 - in stable/8/sys: dev/usb dev/usb/quirk dev/usb/storage sys)

2011-09-10 Thread Hans Petter Selasky
On Saturday 10 September 2011 16:28:12 Kostik Belousov wrote:
 On Sat, Sep 10, 2011 at 03:40:16PM +0200, Hans Petter Selasky wrote:
   Right -- exactly my point. If this change breaks third-party compiled
   USB device drivers, then our current approach to device driver KBIs
   does not allow it to be MFC'd in this form. Are there ways you can
   reformulate the change to avoid breaking those drivers? Sometimes this
   can be done by adding new symbols, rather than replacing currently
   symbols, although mileage varies.
  
  Hi,
  
  Here is my proposal:
  
  Implement test for automatic quirks in function which has access to the
  USB device structure. This decouples the structure change in struct
  usbd_lookup_info.
  
  The only structure which needs change is struct usb_device. In
  9-current this structure will be kept as is. In 8-stable the new element
  will be moved to the end of the structure like suggested, and then there
  shouldn't be any problems.
  
  Please find patches attached.
  
  --HPS
  
  Commit message:
  
  Refactor auto-quirk solution so that we break as few external
  drivers as possible.
  
  PR: usb/160299
  Approved by:re (kib)
  Suggested by:   rwatson
  MFC after:  0 days
 
 First, can you, please, regenerate the diff for stable/8 against the
 code before r225458 ? I want to read diff to see ABI change, assuming
 r225458 was not done at all.
 
 Second, you cannot decrement __FreeBSD_version. In fact, you shall
 increment it once more in the patch for stable/8.

Ok.

Please find attached output from:

svn diff -r 225457 sys/

--HPS
Index: sys/dev/usb/usb_msctest.h
===
--- sys/dev/usb/usb_msctest.h   (revision 225457)
+++ sys/dev/usb/usb_msctest.h   (working copy)
@@ -40,5 +40,7 @@
uint8_t iface_index);
 usb_error_t usb_msc_eject(struct usb_device *udev,
uint8_t iface_index, int method);
+usb_error_t usb_msc_auto_quirk(struct usb_device *udev,
+   uint8_t iface_index);
 
 #endif /* _USB_MSCTEST_H_ */
Index: sys/dev/usb/quirk/usb_quirk.c
===
--- sys/dev/usb/quirk/usb_quirk.c   (revision 225457)
+++ sys/dev/usb/quirk/usb_quirk.c   (working copy)
@@ -148,12 +148,10 @@
UQ_MSC_FORCE_PROTO_SCSI),
USB_QUIRK(AIPTEK, POCKETCAM3M, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI),
-   USB_QUIRK(AIPTEK2, SUNPLUS_TECH, 0x, 0x, UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(ALCOR, SDCR_6335, 0x, 0x, UQ_MSC_NO_TEST_UNIT_READY,
UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(ALCOR, SDCR_6362, 0x, 0x, UQ_MSC_NO_TEST_UNIT_READY,
UQ_MSC_NO_SYNC_CACHE),
-   USB_QUIRK(ALCOR, AU6390, 0x, 0x, UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(ALCOR, UMCR_9361, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN),
USB_QUIRK(ALCOR, TRANSCEND, 0x, 0x, UQ_MSC_NO_GETMAXLUN,
@@ -173,14 +171,12 @@
USB_QUIRK(CENTURY, EX35QUAT, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ,
UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE),
-   USB_QUIRK(CENTURY, EX35SW4_SB4, 0x, 0x, UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(CYPRESS, XX6830XX, 0x, 0x, UQ_MSC_NO_GETMAXLUN,
UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(DESKNOTE, UCR_61S2B, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI),
USB_QUIRK(DMI, CFSM_RW, 0x, 0x, UQ_MSC_FORCE_PROTO_SCSI,
UQ_MSC_NO_GETMAXLUN),
-   USB_QUIRK(DMI, DISK, 0x000, 0x, UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(EPSON, STYLUS_875DC, 0x, 0x, UQ_MSC_FORCE_WIRE_CBI,
UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY),
USB_QUIRK(EPSON, STYLUS_895, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
@@ -188,7 +184,6 @@
USB_QUIRK(FEIYA, 5IN1, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI),
USB_QUIRK(FREECOM, DVD, 0x, 0x, UQ_MSC_FORCE_PROTO_SCSI),
-   USB_QUIRK(FREECOM, HDD, 0x, 0x, UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(FUJIPHOTO, MASS0100, 0x, 0x, UQ_MSC_FORCE_WIRE_CBI_I,
UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_RS_CLEAR_UA, 
UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(GENESYS, GL641USB2IDE, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
@@ -232,7 +227,6 @@
USB_QUIRK(IOMEGA, ZIP100, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI,
UQ_MSC_NO_TEST_UNIT_READY), /* XXX ZIP drives can also use ATAPI */
-   USB_QUIRK(JMICRON, JM20336, 0x, 0x, UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(JMICRON, JM20337, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI,
UQ_MSC_NO_SYNC_CACHE),
@@ -279,8 +273,6 @@

Re: Request for patch approval (Re: svn commit: r225458 - in stable/8/sys: dev/usb dev/usb/quirk dev/usb/storage sys)

2011-09-10 Thread Kostik Belousov
On Sat, Sep 10, 2011 at 04:39:37PM +0200, Hans Petter Selasky wrote:
 On Saturday 10 September 2011 16:28:12 Kostik Belousov wrote:
  On Sat, Sep 10, 2011 at 03:40:16PM +0200, Hans Petter Selasky wrote:
Right -- exactly my point. If this change breaks third-party compiled
USB device drivers, then our current approach to device driver KBIs
does not allow it to be MFC'd in this form. Are there ways you can
reformulate the change to avoid breaking those drivers? Sometimes this
can be done by adding new symbols, rather than replacing currently
symbols, although mileage varies.
   
   Hi,
   
   Here is my proposal:
   
   Implement test for automatic quirks in function which has access to the
   USB device structure. This decouples the structure change in struct
   usbd_lookup_info.
   
   The only structure which needs change is struct usb_device. In
   9-current this structure will be kept as is. In 8-stable the new element
   will be moved to the end of the structure like suggested, and then there
   shouldn't be any problems.
   
   Please find patches attached.
   
   --HPS
   
   Commit message:
   
   Refactor auto-quirk solution so that we break as few external
   drivers as possible.
   
   PR: usb/160299
   Approved by:re (kib)
   Suggested by:   rwatson
   MFC after:  0 days
  
  First, can you, please, regenerate the diff for stable/8 against the
  code before r225458 ? I want to read diff to see ABI change, assuming
  r225458 was not done at all.
  
  Second, you cannot decrement __FreeBSD_version. In fact, you shall
  increment it once more in the patch for stable/8.
 
 Ok.
 
 Please find attached output from:
 
 svn diff -r 225457 sys/

For me, it looks fine. Thank you.


pgp1PevhJ8zAc.pgp
Description: PGP signature


svn commit: r225469 - in head/sys: dev/usb dev/usb/quirk sys

2011-09-10 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Sep 10 15:55:36 2011
New Revision: 225469
URL: http://svn.freebsd.org/changeset/base/225469

Log:
  Refactor auto-quirk solution so that we break as few external
  drivers as possible.
  
  PR:   usb/160299
  Approved by:  re (kib)
  Suggested by: rwatson
  MFC after:0 days

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_dynamic.c
  head/sys/dev/usb/usb_dynamic.h
  head/sys/dev/usb/usbdi.h
  head/sys/sys/param.h

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==
--- head/sys/dev/usb/quirk/usb_quirk.c  Sat Sep 10 12:36:11 2011
(r225468)
+++ head/sys/dev/usb/quirk/usb_quirk.c  Sat Sep 10 15:55:36 2011
(r225469)
@@ -588,7 +588,7 @@ usb_test_quirk_by_info(const struct usbd
}
mtx_unlock(usb_quirk_mtx);
 done:
-   return (usb_test_quirk_w(info, quirk));
+   return (0); /* no quirk match */
 }
 
 static struct usb_quirk_entry *

Modified: head/sys/dev/usb/usb_device.c
==
--- head/sys/dev/usb/usb_device.c   Sat Sep 10 12:36:11 2011
(r225468)
+++ head/sys/dev/usb/usb_device.c   Sat Sep 10 15:55:36 2011
(r225469)
@@ -1239,8 +1239,6 @@ static void
 usb_init_attach_arg(struct usb_device *udev,
 struct usb_attach_arg *uaa)
 {
-   uint8_t x;
-
memset(uaa, 0, sizeof(*uaa));
 
uaa-device = udev;
@@ -1256,9 +1254,6 @@ usb_init_attach_arg(struct usb_device *u
uaa-info.bDeviceProtocol = udev-ddesc.bDeviceProtocol;
uaa-info.bConfigIndex = udev-curr_config_index;
uaa-info.bConfigNum = udev-curr_config_no;
-
-   for (x = 0; x != USB_MAX_AUTO_QUIRK; x++)
-   uaa-info.autoQuirk[x] = udev-autoQuirk[x];
 }
 
 /**
@@ -2389,8 +2384,22 @@ uint8_t
 usb_test_quirk(const struct usb_attach_arg *uaa, uint16_t quirk)
 {
uint8_t found;
+   uint8_t x;
+
+   if (quirk == UQ_NONE)
+   return (0);
+
+   /* search the automatic per device quirks first */
+
+   for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) {
+   if (uaa-device-autoQuirk[x] == quirk)
+   return (1);
+   }
+
+   /* search global quirk table, if any */
 
found = (usb_test_quirk_p) (uaa-info, quirk);
+
return (found);
 }
 
@@ -2723,7 +2732,8 @@ usbd_add_dynamic_quirk(struct usb_device
uint8_t x;
 
for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) {
-   if (udev-autoQuirk[x] == 0) {
+   if (udev-autoQuirk[x] == 0 ||
+   udev-autoQuirk[x] == quirk) {
udev-autoQuirk[x] = quirk;
return (0); /* success */
}

Modified: head/sys/dev/usb/usb_dynamic.c
==
--- head/sys/dev/usb/usb_dynamic.c  Sat Sep 10 12:36:11 2011
(r225468)
+++ head/sys/dev/usb/usb_dynamic.c  Sat Sep 10 15:55:36 2011
(r225469)
@@ -50,12 +50,12 @@
 #include dev/usb/usb_process.h
 #include dev/usb/usb_device.h
 #include dev/usb/usb_dynamic.h
-#include dev/usb/quirk/usb_quirk.h
 
 /* function prototypes */
 static usb_handle_req_t usb_temp_get_desc_w;
 static usb_temp_setup_by_index_t usb_temp_setup_by_index_w;
 static usb_temp_unsetup_t usb_temp_unsetup_w;
+static usb_test_quirk_t usb_test_quirk_w;
 static usb_quirk_ioctl_t usb_quirk_ioctl_w;
 
 /* global variables */
@@ -72,19 +72,9 @@ usb_temp_setup_by_index_w(struct usb_dev
return (USB_ERR_INVAL);
 }
 
-uint8_t
+static uint8_t
 usb_test_quirk_w(const struct usbd_lookup_info *info, uint16_t quirk)
 {
-   uint8_t x;
-
-   if (quirk == UQ_NONE)
-   return (0); /* no match */
-
-   for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) {
-   if (info-autoQuirk[x] == quirk)
-   return (1); /* match */
-   }
-
return (0); /* no match */
 }
 

Modified: head/sys/dev/usb/usb_dynamic.h
==
--- head/sys/dev/usb/usb_dynamic.h  Sat Sep 10 12:36:11 2011
(r225468)
+++ head/sys/dev/usb/usb_dynamic.h  Sat Sep 10 15:55:36 2011
(r225469)
@@ -57,6 +57,5 @@ extern devclass_t usb_devclass_ptr;
 void   usb_temp_unload(void *);
 void   usb_quirk_unload(void *);
 void   usb_bus_unload(void *);
-usb_test_quirk_t usb_test_quirk_w;
 
 #endif /* _USB_DYNAMIC_H_ */

Modified: head/sys/dev/usb/usbdi.h
==
--- head/sys/dev/usb/usbdi.hSat Sep 10 12:36:11 2011(r225468)
+++ head/sys/dev/usb/usbdi.hSat Sep 10 15:55:36 2011(r225469)
@@ 

svn commit: r225470 - in stable/8/sys: dev/usb dev/usb/quirk sys

2011-09-10 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Sep 10 16:52:15 2011
New Revision: 225470
URL: http://svn.freebsd.org/changeset/base/225470

Log:
  MFC r225469:
  
  Refactor auto-quirk solution so that we break as few external
  drivers as possible.
  
  PR:   usb/160299
  Suggested by: rwatson

Modified:
  stable/8/sys/dev/usb/quirk/usb_quirk.c
  stable/8/sys/dev/usb/usb_device.c
  stable/8/sys/dev/usb/usb_device.h
  stable/8/sys/dev/usb/usb_dynamic.c
  stable/8/sys/dev/usb/usb_dynamic.h
  stable/8/sys/dev/usb/usbdi.h
  stable/8/sys/sys/param.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/8/sys/dev/usb/quirk/usb_quirk.c  Sat Sep 10 15:55:36 2011
(r225469)
+++ stable/8/sys/dev/usb/quirk/usb_quirk.c  Sat Sep 10 16:52:15 2011
(r225470)
@@ -588,7 +588,7 @@ usb_test_quirk_by_info(const struct usbd
}
mtx_unlock(usb_quirk_mtx);
 done:
-   return (usb_test_quirk_w(info, quirk));
+   return (0); /* no quirk match */
 }
 
 static struct usb_quirk_entry *

Modified: stable/8/sys/dev/usb/usb_device.c
==
--- stable/8/sys/dev/usb/usb_device.c   Sat Sep 10 15:55:36 2011
(r225469)
+++ stable/8/sys/dev/usb/usb_device.c   Sat Sep 10 16:52:15 2011
(r225470)
@@ -1239,8 +1239,6 @@ static void
 usb_init_attach_arg(struct usb_device *udev,
 struct usb_attach_arg *uaa)
 {
-   uint8_t x;
-
memset(uaa, 0, sizeof(*uaa));
 
uaa-device = udev;
@@ -1256,9 +1254,6 @@ usb_init_attach_arg(struct usb_device *u
uaa-info.bDeviceProtocol = udev-ddesc.bDeviceProtocol;
uaa-info.bConfigIndex = udev-curr_config_index;
uaa-info.bConfigNum = udev-curr_config_no;
-
-   for (x = 0; x != USB_MAX_AUTO_QUIRK; x++)
-   uaa-info.autoQuirk[x] = udev-autoQuirk[x];
 }
 
 /**
@@ -2389,8 +2384,22 @@ uint8_t
 usb_test_quirk(const struct usb_attach_arg *uaa, uint16_t quirk)
 {
uint8_t found;
+   uint8_t x;
+
+   if (quirk == UQ_NONE)
+   return (0);
+
+   /* search the automatic per device quirks first */
+
+   for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) {
+   if (uaa-device-autoQuirk[x] == quirk)
+   return (1);
+   }
+
+   /* search global quirk table, if any */
 
found = (usb_test_quirk_p) (uaa-info, quirk);
+
return (found);
 }
 
@@ -2798,7 +2807,8 @@ usbd_add_dynamic_quirk(struct usb_device
uint8_t x;
 
for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) {
-   if (udev-autoQuirk[x] == 0) {
+   if (udev-autoQuirk[x] == 0 ||
+   udev-autoQuirk[x] == quirk) {
udev-autoQuirk[x] = quirk;
return (0); /* success */
}

Modified: stable/8/sys/dev/usb/usb_device.h
==
--- stable/8/sys/dev/usb/usb_device.h   Sat Sep 10 15:55:36 2011
(r225469)
+++ stable/8/sys/dev/usb/usb_device.h   Sat Sep 10 16:52:15 2011
(r225470)
@@ -149,7 +149,6 @@ struct usb_device {
 
uint16_t power; /* mA the device uses */
uint16_t langid;/* language for strings */
-   uint16_t autoQuirk[USB_MAX_AUTO_QUIRK]; /* dynamic quirks */
 
uint8_t address;/* device addess */
uint8_t device_index;   /* device index in bus-devices */
@@ -191,6 +190,8 @@ struct usb_device {
 #endif
 
uint32_t clear_stall_errors;/* number of clear-stall failures */
+
+   uint16_t autoQuirk[USB_MAX_AUTO_QUIRK]; /* dynamic quirks */
 };
 
 /* globals */

Modified: stable/8/sys/dev/usb/usb_dynamic.c
==
--- stable/8/sys/dev/usb/usb_dynamic.c  Sat Sep 10 15:55:36 2011
(r225469)
+++ stable/8/sys/dev/usb/usb_dynamic.c  Sat Sep 10 16:52:15 2011
(r225470)
@@ -50,12 +50,12 @@
 #include dev/usb/usb_process.h
 #include dev/usb/usb_device.h
 #include dev/usb/usb_dynamic.h
-#include dev/usb/quirk/usb_quirk.h
 
 /* function prototypes */
 static usb_handle_req_t usb_temp_get_desc_w;
 static usb_temp_setup_by_index_t usb_temp_setup_by_index_w;
 static usb_temp_unsetup_t usb_temp_unsetup_w;
+static usb_test_quirk_t usb_test_quirk_w;
 static usb_quirk_ioctl_t usb_quirk_ioctl_w;
 
 /* global variables */
@@ -72,19 +72,9 @@ usb_temp_setup_by_index_w(struct usb_dev
return (USB_ERR_INVAL);
 }
 

svn commit: r225471 - stable/8/sys/dev/sound/usb

2011-09-10 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Sep 10 16:56:38 2011
New Revision: 225471
URL: http://svn.freebsd.org/changeset/base/225471

Log:
  MFC r225414:
  Fix precedence warning when compiling kernel with clang.

Modified:
  stable/8/sys/dev/sound/usb/uaudio.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/sound/usb/uaudio.c
==
--- stable/8/sys/dev/sound/usb/uaudio.c Sat Sep 10 16:52:15 2011
(r225470)
+++ stable/8/sys/dev/sound/usb/uaudio.c Sat Sep 10 16:56:38 2011
(r225471)
@@ -927,8 +927,8 @@ uaudio_chan_fill_info_sub(struct uaudio_
continue;
}
if (asf1d-bLength  (sizeof(*asf1d) +
-   (asf1d-bSamFreqType == 0) ? 6 :
-   (asf1d-bSamFreqType * 3))) {
+   ((asf1d-bSamFreqType == 0) ? 6 :
+   (asf1d-bSamFreqType * 3 {
DPRINTFN(11, 'asf1d' descriptor is too 
short\n);
asf1d = NULL;
continue;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org