Bugzilla – Attachment 202610 Details for
Bug 370850
new hwinfo ps3 network code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
reworked patch
dif (text/plain), 4.62 KB, created by
Steffen Winterfeldt
on 2008-03-17 15:45:03 UTC
(
hide
)
Description:
reworked patch
Filename:
MIME Type:
Creator:
Steffen Winterfeldt
Created:
2008-03-17 15:45:03 UTC
Size:
4.62 KB
patch
obsolete
>--- src/ids/src/bus (revision 1841) >+++ src/ids/src/bus (working copy) >@@ -75,3 +75,7 @@ > > bus.id 0x8d > +bus.name IUCV >+ >+ bus.id 0x8e >++bus.name PS3 >+ >--- src/hd/hd.c (revision 1841) >+++ src/hd/hd.c (working copy) >@@ -5754,6 +5754,30 @@ > } > > >+hd_t *hd_find_sysfs_id_devname(hd_data_t *hd_data, char *id, char *devname) >+{ >+ hd_t *hd; >+ >+ if(id && *id && devname) { >+ for(hd = hd_data->hd; hd; hd = hd->next) { >+ if( >+ hd->sysfs_id && >+ !strcmp(hd->sysfs_id, id) && >+ ( >+ !hd->unix_dev_name || >+ ( >+ hd->unix_dev_name && >+ !strcmp(hd->unix_dev_name, devname) >+ ) >+ ) >+ ) return hd; >+ } >+ } >+ >+ return NULL; >+} >+ >+ > hd_sysfsdrv_t *hd_free_sysfsdrv(hd_sysfsdrv_t *sf) > { > hd_sysfsdrv_t *next; >--- src/hd/hd_int.h (revision 1841) >+++ src/hd/hd_int.h (working copy) >@@ -209,6 +209,7 @@ > void read_udevinfo(hd_data_t *hd_data); > > hd_t *hd_find_sysfs_id(hd_data_t *hd_data, char *id); >+hd_t *hd_find_sysfs_id_devname(hd_data_t *hd_data, char *id, char *devname); > int hd_attr_uint(char* attr, uint64_t* u, int base); > str_list_t *hd_attr_list(char *str); > char *hd_sysfs_id(char *path); >--- src/hd/pci.c (revision 1841) >+++ src/hd/pci.c (working copy) >@@ -933,10 +933,10 @@ > void hd_read_ps3_system_bus(hd_data_t *hd_data) > { > char *s, *ps3_name; >- int scsi_cnt = 0; >+ int scsi_cnt = 0, eth_cnt = 0, wlan_cnt = 0; > hd_t *hd; >- str_list_t *sf_bus, *sf_bus_e; >- char *sf_dev; >+ str_list_t *sf_bus, *sf_bus_e, *sf_eth_dev, *sf_eth_dev_e; >+ char *sf_dev, *sf_eth_net, *sf_eth_wireless; > > sf_bus = reverse_str_list(read_dir("/sys/bus/ps3_system_bus/devices", 'l')); > >@@ -961,23 +961,41 @@ > ADD2LOG(" modalias = \"%s\"\n", ps3_name); > } > >- if( ps3_name && !strcmp(ps3_name, "ps3:3")) { >- hd = add_hd_entry(hd_data, __LINE__, 0); >- hd->bus.id = bus_ps3_system_bus; >+ /* network devices */ >+ if(ps3_name && !strcmp(ps3_name, "ps3:3")) { >+ /* read list of available devices */ >+ sf_eth_net = new_str(hd_read_sysfs_link(sf_dev, "net")); >+ sf_eth_dev = read_dir(sf_eth_net, 'd'); > >- hd->vendor.id = MAKE_ID(TAG_PCI, 0x104d); /* Sony */ >+ /* add entries for available devices */ >+ for(sf_eth_dev_e = sf_eth_dev; sf_eth_dev_e; sf_eth_dev_e = sf_eth_dev_e->next) { >+ hd = add_hd_entry(hd_data, __LINE__, 0); >+ hd->bus.id = bus_ps3_system_bus; >+ hd->sysfs_bus_id = new_str(sf_bus_e->str); >+ hd->slot = eth_cnt + wlan_cnt; >+ hd->vendor.id = MAKE_ID(TAG_PCI, 0x104d); /* Sony */ >+ hd->device.id = MAKE_ID(TAG_SPECIAL, 0x1003); /* PS3_DEV_TYPE_SB_GELIC */ >+ hd->base_class.id = bc_network; >+ hd->sysfs_id = new_str(hd_sysfs_id(sf_dev)); >+ hd->modalias = new_str(ps3_name); >+ hd->unix_dev_name = new_str(sf_eth_dev_e->str); /* this is needed to correctly link to interfaces later */ > >- hd->base_class.id = bc_network; >- hd->sub_class.id = 0; /* ethernet */ >- hd->device.id = MAKE_ID(TAG_SPECIAL, 0x1003); /* PS3_DEV_TYPE_SB_GELIC */ >- str_printf(&hd->device.name, 0, "PS3 Ethernet card %d", hd->slot); >+ /* ethernet and wireless differ only by directory "wireless" so check for it */ >+ sf_eth_wireless = hd_read_sysfs_link(hd_read_sysfs_link(sf_eth_net, sf_eth_dev_e->str), "wireless"); >+ if(sf_eth_wireless) { >+ hd->sub_class.id = 0x82; /* wireless */ >+ str_printf(&hd->device.name, 0, "PS3 Wireless card %d", wlan_cnt++); >+ } >+ else { >+ hd->sub_class.id = 0; /* ethernet */ >+ str_printf(&hd->device.name, 0, "PS3 Ethernet card %d", eth_cnt++); >+ } >+ s = hd_sysfs_find_driver(hd_data, hd->sysfs_id, 1); >+ if(s) add_str_list(&hd->drivers, s); >+ } > >- hd->modalias = new_str(ps3_name); >- >- hd->sysfs_id = new_str(hd_sysfs_id(sf_dev)); >- hd->sysfs_bus_id = new_str(sf_bus_e->str); >- s = hd_sysfs_find_driver(hd_data, hd->sysfs_id, 1); >- if(s) add_str_list(&hd->drivers, s); >+ sf_eth_net = free_mem(sf_eth_net); >+ sf_eth_dev = free_str_list(sf_eth_dev); > } > > if ( ps3_name && !strcmp(ps3_name, "ps3:7")) { >--- src/hd/net.c (revision 1841) >+++ src/hd/net.c (working copy) >@@ -258,6 +258,16 @@ > hd_card = hd_find_sysfs_id(hd_data, s); > } > } >+ >+ /* if one card has several interfaces (as with PS3), check interface names, too */ >+ if( >+ hd->unix_dev_name && >+ hd_card->unix_dev_name && >+ strcmp(hd->unix_dev_name, hd_card->unix_dev_name) >+ ) { >+ hd_card = hd_find_sysfs_id_devname(hd_data, s, hd->unix_dev_name); >+ } >+ > s = free_mem(s); > > if(hd_card) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 370850
:
201650
|
202521
|
202572
| 202610