- CFStringRef productName;
-
- // check if a "Product Name" has been provided
- val = IORegistryEntrySearchCFProperty(interface,
- kIOServicePlane,
- CFSTR(kIOPropertyProductNameKey),
- NULL,
- kIORegistryIterateRecursively | kIORegistryIterateParents);
- if (val == NULL) {
- // check if a "USB Product Name" has been provided
- val = IORegistryEntrySearchCFProperty(interface,
- kIOServicePlane,
- CFSTR(kUSBProductString),
- NULL,
- kIORegistryIterateRecursively | kIORegistryIterateParents);
- }
- if (val != NULL) {
- productName = IOCopyCFStringValue(val);
- CFRelease(val);
-
- if (productName != NULL) {
- if (CFStringGetLength(productName) > 0) {
- // if we have a [somewhat reasonable?] product name
- if (interfacePrivate->name != NULL) {
- CFRelease(interfacePrivate->name);
- }
- interfacePrivate->name = CFRetain(productName);
- if (interfacePrivate->localized_name != NULL) {
- CFRelease(interfacePrivate->localized_name);
- }
- interfacePrivate->localized_name = copy_interface_string(bundle, productName, TRUE);
-
- // if not provided, also check if the product name
- // matches a CCL script
- if ((modemCCL == NULL) &&
- is_valid_connection_script(productName)) {
- set_connection_script(interfacePrivate, productName);
- }
- }
-
- CFRelease(productName);
+ // get USB info (if available)
+ processUSBInterface(interfacePrivate,
+ interface,
+ interface_dict,
+ controller,
+ controller_dict,
+ bus,
+ bus_dict);
+
+ // set interface "name"
+ if (update_interface_name(interfacePrivate, interface, TRUE)) {
+ // if "ModemCCL" not provided, also check if the product/interface
+ // name matches a CCL script
+ if ((modemCCL == NULL) &&
+ is_valid_connection_script(interfacePrivate->name)) {
+ set_connection_script(interfacePrivate, interfacePrivate->name);