Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2008 00:05:31 +0200
From:      Nick Hibma <nick@anywi.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/127453: ubsa, uark, ubser, uftdi, and friends should all be put in one big bag, usbser
Message-ID:  <1221689131.035456.43087.nullmailer@van-laarhoven.org>
Resent-Message-ID: <200809172210.m8HMA1uj021098@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         127453
>Category:       kern
>Synopsis:       ubsa, uark, ubser, uftdi, and friends should all be put in one big bag, usbser
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 17 22:10:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Nick Hibma
>Release:        FreeBSD 7.0-STABLE i386
>Organization:
AnyWi Technologies
>Environment:
System: FreeBSD hind.van-laarhoven.org 7.0-STABLE FreeBSD 7.0-STABLE #3: Thu Aug 14 21:10:55 CEST 2008 toor@hind.van-laarhoven.org:/usr/src/sys/i386/compile/HIND i386

>Description:

It gets annoying after a while to have to search for the correct driver for
your serial device. There is simply too many of them. It would be simpler to
have to load usbser, ucom and usb and be done with it.

The reason is simple: We have developed yet another serial port driver for
Option Globetrotter and Huawei E220 cards (multiple serial ports on 1 device,
unlike the ubsa hack for these devices) which adds yet another label. This will be committed in the next month.

Most obvious consequence is the larger size of the kernel because of bloat:

 sys/modules % ls -l {uark,ubsa,usbser}/*.kld
 -rw-r--r--  1 nick  nick   4748 Sep 17 23:25 uark/uark.kld
 -rw-r--r--  1 nick  nick   7180 Sep 17 23:25 ubsa/ubsa.kld
 -rw-r--r--  1 nick  nick  10204 Sep 17 22:31 usbser/usbser.kld

klds for the individual drivers are not big, but you usually just need 1 or 2,
not all of them. Thus: adding 10+ * 10k - 17% ~ 100k, which is a lot if you
just need the one driver. Then again, umass is 30*270KB in size (if CAM is just
needed for umass and nothing else and counted in here).

>How-To-Repeat:

Buy a serial device and figure out the USB device driver that supports it.
Example: Currently support for Option Globetrotter Fusion cards is included in
ubsa. Go figure.

>Fix:

Step 1: simply throw them all into 1 device driver usbser

	- Change sys/conf/files to indicate usbser as the device for uark.c,
	  ubsa.c, etc/
	- Replace all the directories uark, ubsa, etc. in sys/modules with
	  the one directory usbser.
	- Combine the man pages uark.4, ubsa.4, etc. into usbser.4
	- Update release/ documentation?
	- Add aliases uark, ubsa, etc. for usbser?

Step 2: separate the code to show similarities possibly

	- Move uark.c, ubsa.c, etc. into sys/dev/usb/usbser to separate them.
	- Possibly rename ubsa.c to a more generic name, like belkin.c
	- Update sys/conf/files.
	- Update sys/modules/usbser/Makefile

Step 3: integrate stuff from various places to conserve space, like debugging
	output, probing routines, etc.

The last step might be less productive. uark does not share a lot of code wth
ubsa for example if I read the code correctly.

Candidates:

	uark.ko
	ubsa.ko
	ubser.ko
	ucycom.ko
	ufoma.ko
	uftdi.ko
	umct.ko
	umodem.ko
	uplcom.ko
	uslcom.ko
	uvisor.ko
	uvscom.ko

and in the future

	usm.ko

Note: some of them, ucycom, still need to be converted to use ucom.
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1221689131.035456.43087.nullmailer>