Date: Mon, 21 May 2018 17:33:53 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333989 - head/sys/dev/usb/template Message-ID: <201805211733.w4LHXrM1099962@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Mon May 21 17:33:52 2018 New Revision: 333989 URL: https://svnweb.freebsd.org/changeset/base/333989 Log: Add a somewhat ugly hack that makes OSX serial device node names human-readable. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_multi.c head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Mon May 21 16:50:27 2018 (r333988) +++ head/sys/dev/usb/template/usb_template_modem.c Mon May 21 17:33:52 2018 (r333989) @@ -81,7 +81,13 @@ enum { #define MODEM_DEFAULT_INTERFACE "Virtual serial port" #define MODEM_DEFAULT_MANUFACTURER USB_TEMPLATE_MANUFACTURER #define MODEM_DEFAULT_PRODUCT "Virtual serial port" -#define MODEM_DEFAULT_SERIAL_NUMBER "March 2008" +/* + * The reason for this being called like this is that OSX + * derives the device node name from it, resulting in a somewhat + * user-friendly "/dev/cu.usbmodemFreeBSD1". And yes, the "1" + * needs to be there, otherwise OSX will mangle it. + */ +#define MODEM_DEFAULT_SERIAL_NUMBER "FreeBSD1" static struct usb_string_descriptor modem_interface; static struct usb_string_descriptor modem_manufacturer; Modified: head/sys/dev/usb/template/usb_template_multi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_multi.c Mon May 21 16:50:27 2018 (r333988) +++ head/sys/dev/usb/template/usb_template_multi.c Mon May 21 17:33:52 2018 (r333989) @@ -99,7 +99,13 @@ enum { #define MULTI_DEFAULT_CONFIGURATION "Default configuration" #define MULTI_DEFAULT_MANUFACTURER USB_TEMPLATE_MANUFACTURER #define MULTI_DEFAULT_PRODUCT "Multifunction Device" -#define MULTI_DEFAULT_SERIAL_NUMBER "May 2018" +/* + * The reason for this being called like this is that OSX + * derives the device node name from it, resulting in a somewhat + * user-friendly "/dev/cu.usbmodemFreeBSD1". And yes, the "1" + * needs to be there, otherwise OSX will mangle it. + */ +#define MULTI_DEFAULT_SERIAL_NUMBER "FreeBSD1" static struct usb_string_descriptor multi_modem; static struct usb_string_descriptor multi_eth_mac; Modified: head/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- head/sys/dev/usb/template/usb_template_serialnet.c Mon May 21 16:50:27 2018 (r333988) +++ head/sys/dev/usb/template/usb_template_serialnet.c Mon May 21 17:33:52 2018 (r333989) @@ -97,7 +97,13 @@ enum { #define SERIALNET_DEFAULT_CONFIGURATION "Default configuration" #define SERIALNET_DEFAULT_MANUFACTURER USB_TEMPLATE_MANUFACTURER #define SERIALNET_DEFAULT_PRODUCT "Serial/Ethernet device" -#define SERIALNET_DEFAULT_SERIAL_NUMBER "January 2015" +/* + * The reason for this being called like this is that OSX + * derives the device node name from it, resulting in a somewhat + * user-friendly "/dev/cu.usbmodemFreeBSD1". And yes, the "1" + * needs to be there, otherwise OSX will mangle it. + */ +#define SERIALNET_DEFAULT_SERIAL_NUMBER "FreeBSD1" static struct usb_string_descriptor serialnet_modem; static struct usb_string_descriptor serialnet_eth_mac;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805211733.w4LHXrM1099962>