|
Lines 933-942
Link Here
|
| 933 |
void hd_read_ps3_system_bus(hd_data_t *hd_data) |
933 |
void hd_read_ps3_system_bus(hd_data_t *hd_data) |
| 934 |
{ |
934 |
{ |
| 935 |
char *s, *ps3_name; |
935 |
char *s, *ps3_name; |
| 936 |
int scsi_cnt = 0; |
936 |
int scsi_cnt = 0, eth_cnt = 0, wlan_cnt = 0; |
| 937 |
hd_t *hd; |
937 |
hd_t *hd; |
| 938 |
str_list_t *sf_bus, *sf_bus_e; |
938 |
str_list_t *sf_bus, *sf_bus_e, *sf_eth_dev, *sf_eth_dev_e; |
| 939 |
char *sf_dev; |
939 |
char *sf_dev, *sf_eth_net, *sf_eth_wireless; |
| 940 |
|
940 |
|
| 941 |
sf_bus = reverse_str_list(read_dir("/sys/bus/ps3_system_bus/devices", 'l')); |
941 |
sf_bus = reverse_str_list(read_dir("/sys/bus/ps3_system_bus/devices", 'l')); |
| 942 |
|
942 |
|
|
Lines 961-983
Link Here
|
| 961 |
ADD2LOG(" modalias = \"%s\"\n", ps3_name); |
961 |
ADD2LOG(" modalias = \"%s\"\n", ps3_name); |
| 962 |
} |
962 |
} |
| 963 |
|
963 |
|
| 964 |
if( ps3_name && !strcmp(ps3_name, "ps3:3")) { |
964 |
/* network devices */ |
| 965 |
hd = add_hd_entry(hd_data, __LINE__, 0); |
965 |
if(ps3_name && !strcmp(ps3_name, "ps3:3")) { |
| 966 |
hd->bus.id = bus_ps3_system_bus; |
966 |
/* read list of available devices */ |
|
|
967 |
sf_eth_net = new_str(hd_read_sysfs_link(sf_dev, "net")); |
| 968 |
sf_eth_dev = read_dir(sf_eth_net, 'd'); |
| 967 |
|
969 |
|
| 968 |
hd->vendor.id = MAKE_ID(TAG_PCI, 0x104d); /* Sony */ |
970 |
/* add entries for available devices */ |
|
|
971 |
for(sf_eth_dev_e = sf_eth_dev; sf_eth_dev_e; sf_eth_dev_e = sf_eth_dev_e->next) { |
| 972 |
hd = add_hd_entry(hd_data, __LINE__, 0); |
| 973 |
hd->bus.id = bus_ps3_system_bus; |
| 974 |
hd->sysfs_bus_id = new_str(sf_bus_e->str); |
| 975 |
hd->slot = eth_cnt + wlan_cnt; |
| 976 |
hd->vendor.id = MAKE_ID(TAG_PCI, 0x104d); /* Sony */ |
| 977 |
hd->device.id = MAKE_ID(TAG_SPECIAL, 0x1003); /* PS3_DEV_TYPE_SB_GELIC */ |
| 978 |
hd->base_class.id = bc_network; |
| 979 |
hd->sysfs_id = new_str(hd_sysfs_id(sf_dev)); |
| 980 |
hd->modalias = new_str(ps3_name); |
| 981 |
hd->unix_dev_name = new_str(sf_eth_dev_e->str); /* this is needed to correctly link to interfaces later */ |
| 969 |
|
982 |
|
| 970 |
hd->base_class.id = bc_network; |
983 |
/* ethernet and wireless differ only by directory "wireless" so check for it */ |
| 971 |
hd->sub_class.id = 0; /* ethernet */ |
984 |
sf_eth_wireless = hd_read_sysfs_link(hd_read_sysfs_link(sf_eth_net, sf_eth_dev_e->str), "wireless"); |
| 972 |
hd->device.id = MAKE_ID(TAG_SPECIAL, 0x1003); /* PS3_DEV_TYPE_SB_GELIC */ |
985 |
if(sf_eth_wireless) { |
| 973 |
str_printf(&hd->device.name, 0, "PS3 Ethernet card %d", hd->slot); |
986 |
hd->sub_class.id = 0x82; /* wireless */ |
|
|
987 |
str_printf(&hd->device.name, 0, "PS3 Wireless card %d", wlan_cnt++); |
| 988 |
} |
| 989 |
else { |
| 990 |
hd->sub_class.id = 0; /* ethernet */ |
| 991 |
str_printf(&hd->device.name, 0, "PS3 Ethernet card %d", eth_cnt++); |
| 992 |
} |
| 993 |
s = hd_sysfs_find_driver(hd_data, hd->sysfs_id, 1); |
| 994 |
if(s) add_str_list(&hd->drivers, s); |
| 995 |
} |
| 974 |
|
996 |
|
| 975 |
hd->modalias = new_str(ps3_name); |
997 |
sf_eth_net = free_mem(sf_eth_net); |
| 976 |
|
998 |
sf_eth_dev = free_str_list(sf_eth_dev); |
| 977 |
hd->sysfs_id = new_str(hd_sysfs_id(sf_dev)); |
|
|
| 978 |
hd->sysfs_bus_id = new_str(sf_bus_e->str); |
| 979 |
s = hd_sysfs_find_driver(hd_data, hd->sysfs_id, 1); |
| 980 |
if(s) add_str_list(&hd->drivers, s); |
| 981 |
} |
999 |
} |
| 982 |
|
1000 |
|
| 983 |
if ( ps3_name && !strcmp(ps3_name, "ps3:7")) { |
1001 |
if ( ps3_name && !strcmp(ps3_name, "ps3:7")) { |