View | Details | Raw Unified | Return to bug 370850
Collapse All | Expand All

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

Return to bug 370850