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

(-)src/ids/src/bus (+4 lines)
Lines 75-77 Link Here
75
75
76
 bus.id			0x8d
76
 bus.id			0x8d
77
+bus.name		IUCV
77
+bus.name		IUCV
78
79
 bus.id			0x8e
80
+bus.name		PS3
81
(-)src/hd/hd.c (+24 lines)
Lines 5754-5759 Link Here
5754
}
5754
}
5755
5755
5756
5756
5757
hd_t *hd_find_sysfs_id_devname(hd_data_t *hd_data, char *id, char *devname)
5758
{
5759
  hd_t *hd;
5760
5761
  if(id && *id && devname) {
5762
    for(hd = hd_data->hd; hd; hd = hd->next) {
5763
      if(
5764
        hd->sysfs_id &&
5765
        !strcmp(hd->sysfs_id, id) &&
5766
        (
5767
          !hd->unix_dev_name ||
5768
          (
5769
            hd->unix_dev_name &&
5770
            !strcmp(hd->unix_dev_name, devname)
5771
          )
5772
        )
5773
      ) return hd;
5774
    }
5775
  }
5776
5777
  return NULL;
5778
}
5779
5780
5757
hd_sysfsdrv_t *hd_free_sysfsdrv(hd_sysfsdrv_t *sf)
5781
hd_sysfsdrv_t *hd_free_sysfsdrv(hd_sysfsdrv_t *sf)
5758
{
5782
{
5759
  hd_sysfsdrv_t *next;
5783
  hd_sysfsdrv_t *next;
(-)src/hd/hd_int.h (+1 lines)
Lines 209-214 Link Here
209
void read_udevinfo(hd_data_t *hd_data);
209
void read_udevinfo(hd_data_t *hd_data);
210
210
211
hd_t *hd_find_sysfs_id(hd_data_t *hd_data, char *id);
211
hd_t *hd_find_sysfs_id(hd_data_t *hd_data, char *id);
212
hd_t *hd_find_sysfs_id_devname(hd_data_t *hd_data, char *id, char *devname);
212
int hd_attr_uint(char* attr, uint64_t* u, int base);
213
int hd_attr_uint(char* attr, uint64_t* u, int base);
213
str_list_t *hd_attr_list(char *str);
214
str_list_t *hd_attr_list(char *str);
214
char *hd_sysfs_id(char *path);
215
char *hd_sysfs_id(char *path);
(-)src/hd/pci.c (-17 / +35 lines)
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")) {
(-)src/hd/net.c (+10 lines)
Lines 258-263 Link Here
258
          hd_card = hd_find_sysfs_id(hd_data, s);
258
          hd_card = hd_find_sysfs_id(hd_data, s);
259
        }
259
        }
260
      }
260
      }
261
262
      /* if one card has several interfaces (as with PS3), check interface names, too */
263
      if(
264
        hd->unix_dev_name &&
265
        hd_card->unix_dev_name &&
266
        strcmp(hd->unix_dev_name, hd_card->unix_dev_name)
267
      ) {
268
        hd_card = hd_find_sysfs_id_devname(hd_data, s, hd->unix_dev_name);
269
      }
270
261
      s = free_mem(s);
271
      s = free_mem(s);
262
272
263
      if(hd_card) {
273
      if(hd_card) {

Return to bug 370850