mirror of https://github.com/aredn/aredn.git
hardware: Expand board_id routine to allow TPLink devices to be obtained
When a device does not have a subsystem device ID we will fall back to the board_detect routine. In the case of a TPLink CPE510 the model will be along the lines of "TP-Link CPE510 v1.0" In the case of TPLink CPE510 this also includes a hardware version so should the hardware be changed in the future we will be able to key off that as well.
This commit is contained in:
parent
08600fd4e8
commit
7c152d7c1e
|
@ -904,8 +904,16 @@ sub validate_longitude
|
||||||
# Get boardid
|
# Get boardid
|
||||||
sub hardware_boardid
|
sub hardware_boardid
|
||||||
{
|
{
|
||||||
my $boardid = `cat /sys/devices/pci0000:00/0000:00:00.0/subsystem_device`;
|
my $boarid="";
|
||||||
|
# Ubiquiti hardware
|
||||||
|
if ( -f '/sys/devices/pci0000:00/0000:00:00.0/subsystem_device' ) {
|
||||||
|
$boardid = `cat /sys/devices/pci0000:00/0000:00:00.0/subsystem_device`;
|
||||||
chomp($boardid);
|
chomp($boardid);
|
||||||
|
} else {
|
||||||
|
# Can't use the subsystem_device so instead use the model
|
||||||
|
$boardid = `/usr/local/bin/get_model`;
|
||||||
|
chomp($boardid);
|
||||||
|
}
|
||||||
return $boardid;
|
return $boardid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue