mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Sort device list by eui64 in acendent order correctly.
This commit is contained in:
parent
ecf44c01f4
commit
4230e8de2f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110179
@ -1112,7 +1112,7 @@ static void
|
|||||||
fw_bus_explore(struct firewire_comm *fc )
|
fw_bus_explore(struct firewire_comm *fc )
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
struct fw_device *fwdev, *tfwdev;
|
struct fw_device *fwdev, *pfwdev, *tfwdev;
|
||||||
u_int32_t addr;
|
u_int32_t addr;
|
||||||
struct fw_xfer *xfer;
|
struct fw_xfer *xfer;
|
||||||
struct fw_pkt *fp;
|
struct fw_pkt *fp;
|
||||||
@ -1176,18 +1176,18 @@ fw_bus_explore(struct firewire_comm *fc )
|
|||||||
fwdev->speed = fc->speed_map->speed[fc->nodeid][fc->ongonode];
|
fwdev->speed = fc->speed_map->speed[fc->nodeid][fc->ongonode];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tfwdev = TAILQ_FIRST(&fc->devices);
|
pfwdev = NULL;
|
||||||
while( tfwdev != NULL &&
|
TAILQ_FOREACH(tfwdev, &fc->devices, link) {
|
||||||
(tfwdev->eui.hi > fwdev->eui.hi) &&
|
if (tfwdev->eui.hi > fwdev->eui.hi ||
|
||||||
((tfwdev->eui.hi == fwdev->eui.hi) &&
|
(tfwdev->eui.hi == fwdev->eui.hi &&
|
||||||
tfwdev->eui.lo > fwdev->eui.lo)){
|
tfwdev->eui.lo > fwdev->eui.lo))
|
||||||
tfwdev = TAILQ_NEXT( tfwdev, link);
|
break;
|
||||||
}
|
pfwdev = tfwdev;
|
||||||
if(tfwdev == NULL){
|
|
||||||
TAILQ_INSERT_TAIL(&fc->devices, fwdev, link);
|
|
||||||
}else{
|
|
||||||
TAILQ_INSERT_BEFORE(tfwdev, fwdev, link);
|
|
||||||
}
|
}
|
||||||
|
if (pfwdev == NULL)
|
||||||
|
TAILQ_INSERT_HEAD(&fc->devices, fwdev, link);
|
||||||
|
else
|
||||||
|
TAILQ_INSERT_AFTER(&fc->devices, pfwdev, fwdev, link);
|
||||||
|
|
||||||
device_printf(fc->bdev, "New %s device ID:%08x%08x\n",
|
device_printf(fc->bdev, "New %s device ID:%08x%08x\n",
|
||||||
linkspeed[fwdev->speed],
|
linkspeed[fwdev->speed],
|
||||||
|
Loading…
Reference in New Issue
Block a user