Project

General

Profile

Actions

Bug #14804

closed

Remove remaining unused legacy from usbgem

Added by Garrett D'Amore 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

The usbgem framework was imported from Muryama's drivers, and provided a shim for making his drivers be able to support pre-GLDv3 (Solaris 8 and 9) and post GLDv3 (Solaris 10 and later).

We have kept a lot of the cruft ifdef'd out, but it does confound searches in e.g. online search tools.

We should remove the code that ostensibly supports GLDv2; it is never compiled, and is these days useless to everyone.

Actions #1

Updated by Garrett D'Amore 5 months ago

While here, we should also remove the code that is conditional on things we never use.

We always configure USBGEM_CONFIG_GLDv3, GEN_CONFIG_FMA (hmm... that was supposed to be GEM_CONFIG_FMA I think), and USBGEM_CONFIG_MAC_PROP.

I suspect that some of the stuff that is meant to be configured is not. And nobody has noticed in 11 years.

Actions #2

Updated by Garrett D'Amore 5 months ago

The FMA support in the framework was never enabled, and looks somewhat vestigal.

In particular it seems to lack any support for registering with the FMA framework.

Actions #3

Updated by Garrett D'Amore 5 months ago

  • Subject changed from Remove GLDv2 legacy from usbgem to Remove remaining GLDv2 legacy from usbgem

So 14408 already removed a lot, but some things were left behind. This is a little more cleanup.

Actions #4

Updated by Garrett D'Amore 5 months ago

  • Subject changed from Remove remaining GLDv2 legacy from usbgem to Remove remaining unused legacy from usbgem
Actions #5

Updated by Electric Monk 5 months ago

  • Gerrit CR set to 2231
Actions #6

Updated by Garrett D'Amore 5 months ago

Testing:

With these changes, no actual code is changed. Here's an elfcmp, which I think only shows differences due to line numbering changes in strtab:

Here is the elfcmp of a build of the usbgem before and after (after is .new) – the only section with differences is .strtab, where it looks like some dynamically generated symbol names are different. (Perhaps because line numbers changed?)

gdamore@rts-build-01:...gldv2/usr/src/uts/intel/usbgem$ /devp02/gdamore/illumos/14084-usbgem-gldv2/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/elfcmp -v obj64/usbgem obj64/usbgem.new
Section .SUNW_ctf is the same
Section .bss is the same
Section .comment is the same
Section .data is the same
Section .dynamic is the same
Section .rela.data is the same
Section .rela.text is the same
Section .rodata is the same
Section .rodata.str1.1 is the same
Section .rodata.str1.8 is the same
Section .shstrtab is the same
Section .strtab differs
  • /tmp/elfcmp.1.28927 Mon Jul 11 22:21:14 2022
    --- /tmp/elfcmp.2.28927 Mon Jul 11 22:21:14 2022 *******
  • 75,88 **
    <1204> usbgem_m_ioctl
    <1219> usbgem_gld3_init
    <1236> usbgem_read_conf
    ! <1253> func.23258
    ! <1268> func.23279
    <1283> usbgem_open_pipes
    ! <1301> func.23323
    <1316> usbgem_close_pipes
    <1335> usbgem_freeze_device
    <1356> usbgem_recover_device
    ! <1378> func.23369
    <1393> p0
    <1396> bcmp
    <1401> stoi
    --- 75,88 ----
    <1204> usbgem_m_ioctl
    <1219> usbgem_gld3_init
    <1236> usbgem_read_conf
    ! <1253> func.23217
    ! <1268> func.23238
    <1283> usbgem_open_pipes
    ! <1301> func.23282
    <1316> usbgem_close_pipes
    <1335> usbgem_freeze_device
    <1356> usbgem_recover_device
    ! <1378> func.23328
    <1393> p0
    <1396> bcmp
    <1401> stoi
    Section .symtab is the same
    Section .text is the same
    gdamore@rts-build-01:...gldv2/usr/src/uts/intel/usbge
Actions #7

Updated by Garrett D'Amore 5 months ago

  • Status changed from New to Pending RTI
  • % Done changed from 0 to 90
Actions #8

Updated by Electric Monk 5 months ago

  • Status changed from Pending RTI to Closed
  • % Done changed from 90 to 100

git commit 7089fa466827d55e61d76b970fc9837cd1aea9ee

commit  7089fa466827d55e61d76b970fc9837cd1aea9ee
Author: Garrett D'Amore <garrett@damore.org>
Date:   2022-07-26T15:29:38.000Z

    14804 Remove remaining unused legacy from usbgem
    Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Actions

Also available in: Atom PDF