Lines Matching defs:phy_info
113 struct mptsas_phyinfo *phy_info, struct sas_rphy *rphy);
121 struct mptsas_phyinfo *phy_info);
123 struct mptsas_phyinfo *phy_info);
389 if (port_info->phy_info[i].identify.handle == handle) {
419 if (port_info->phy_info[i].identify.sas_address ==
454 struct mptsas_phyinfo *phy_info;
461 phy_info = port_info->phy_info;
468 for (i = 0; i < port_info->num_phys; i++, phy_info++) {
469 if(phy_info->port_details != port_details)
471 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
472 mptsas_set_rphy(ioc, phy_info, NULL);
473 phy_info->port_details = NULL;
479 mptsas_get_rphy(struct mptsas_phyinfo *phy_info)
481 if (phy_info->port_details)
482 return phy_info->port_details->rphy;
488 mptsas_set_rphy(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, struct sas_rphy *rphy)
490 if (phy_info->port_details) {
491 phy_info->port_details->rphy = rphy;
505 mptsas_get_port(struct mptsas_phyinfo *phy_info)
507 if (phy_info->port_details)
508 return phy_info->port_details->port;
514 mptsas_set_port(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, struct sas_port *port)
516 if (phy_info->port_details)
517 phy_info->port_details->port = port;
528 mptsas_get_starget(struct mptsas_phyinfo *phy_info)
530 if (phy_info->port_details)
531 return phy_info->port_details->starget;
537 mptsas_set_starget(struct mptsas_phyinfo *phy_info, struct scsi_target *
540 if (phy_info->port_details)
541 phy_info->port_details->starget = starget;
760 struct mptsas_phyinfo *phy_info = NULL;
765 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
767 if (!phy_info)
774 phy_info->attached.handle_enclosure);
776 mptsas_add_device_component(ioc, phy_info->attached.channel,
777 phy_info->attached.id, phy_info->attached.sas_address,
778 phy_info->attached.device_info,
779 phy_info->attached.slot, enclosure_info.enclosure_logical_id);
834 struct mptsas_phyinfo *phy_info, *phy_info_cmp;
840 phy_info = port_info->phy_info;
841 for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) {
842 if (phy_info->attached.handle)
844 port_details = phy_info->port_details;
857 port_details->phy_bitmask &= ~ (1 << phy_info->phy_id);
858 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
859 if (phy_info->phy) {
861 &phy_info->phy->dev, MYIOC_s_FMT
863 phy_info->phy_id, phy_info->phy));
864 sas_port_delete_phy(port_details->port, phy_info->phy);
866 phy_info->port_details = NULL;
872 phy_info = port_info->phy_info;
873 for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) {
874 sas_address = phy_info->attached.sas_address;
879 port_details = phy_info->port_details;
890 if (phy_info->phy_id < 64 )
892 (1 << phy_info->phy_id);
893 phy_info->sas_port_add_phy=1;
897 phy_info->port_details = port_details;
902 phy_info_cmp = &port_info->phy_info[i + 1];
942 port_details = port_info->phy_info[i].port_details;
1410 * @phy_info: describes attached device
1416 mptsas_add_end_device(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info)
1424 if (!phy_info) {
1431 fw_id = phy_info->attached.id;
1433 if (mptsas_get_rphy(phy_info)) {
1440 port = mptsas_get_port(phy_info);
1448 if (phy_info->attached.device_info &
1451 if (phy_info->attached.device_info &
1454 if (phy_info->attached.device_info &
1460 phy_info->attached.channel, phy_info->attached.id,
1461 phy_info->attached.phy_id, (unsigned long long)
1462 phy_info->attached.sas_address);
1464 mptsas_parse_device_info(&identify, &phy_info->attached);
1481 mptsas_set_rphy(ioc, phy_info, rphy);
1488 * @phy_info: describes attached device
1492 mptsas_del_end_device(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info)
1503 if (!phy_info)
1506 fw_id = phy_info->attached.id;
1507 sas_address = phy_info->attached.sas_address;
1509 if (!phy_info->port_details) {
1515 rphy = mptsas_get_rphy(phy_info);
1523 if (phy_info->attached.device_info & MPI_SAS_DEVICE_INFO_SSP_INITIATOR
1524 || phy_info->attached.device_info
1526 || phy_info->attached.device_info
1529 if (phy_info->attached.device_info &
1532 if (phy_info->attached.device_info &
1535 if (phy_info->attached.device_info &
1541 "sas_addr 0x%llx\n", ioc->name, ds, phy_info->attached.channel,
1542 phy_info->attached.id, phy_info->attached.phy_id,
1545 port = mptsas_get_port(phy_info);
1552 port_info = phy_info->portinfo;
1553 phy_info_parent = port_info->phy_info;
1571 mptsas_set_port(ioc, phy_info, NULL);
1572 mptsas_port_delete(ioc, phy_info->port_details);
1579 struct mptsas_phyinfo *phy_info;
1583 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
1585 if (!phy_info)
1587 port_info = phy_info->portinfo;
1592 if (port_info->phy_info[i].attached.sas_address !=
1595 port_info->phy_info[i].attached.channel = sas_device->channel;
1596 port_info->phy_info[i].attached.id = sas_device->id;
1597 port_info->phy_info[i].attached.sas_address =
1599 port_info->phy_info[i].attached.handle = sas_device->handle;
1600 port_info->phy_info[i].attached.handle_parent =
1602 port_info->phy_info[i].attached.handle_enclosure =
1607 return phy_info;
1759 if (p->phy_info[i].attached.sas_address !=
1762 id = p->phy_info[i].attached.id;
1763 channel = p->phy_info[i].attached.channel;
1764 mptsas_set_starget(&p->phy_info[i], starget);
1774 p->phy_info[i].attached.phys_disk_num = id;
1818 if (p->phy_info[i].attached.sas_address !=
1825 p->phy_info[i].attached.channel,
1826 p->phy_info[i].attached.id,
1827 p->phy_info[i].attached.phy_id, (unsigned long long)
1828 p->phy_info[i].attached.sas_address);
1830 mptsas_set_starget(&p->phy_info[i], NULL);
1869 if (p->phy_info[i].attached.sas_address !=
1877 p->phy_info[i].attached.channel,
1878 p->phy_info[i].attached.id))
2167 if (p->phy_info[i].attached.sas_address ==
2169 enclosure_handle = p->phy_info[i].
2199 if (p->phy_info[i].attached.sas_address ==
2201 rc = p->phy_info[i].attached.slot;
2258 if (port_info && port_info->phy_info)
2260 port_info->phy_info[0].phy->identify.sas_address;
2402 port_info->phy_info = kcalloc(port_info->num_phys,
2404 if (!port_info->phy_info) {
2416 port_info->phy_info[i].phy_id = i;
2417 port_info->phy_info[i].port_id =
2419 port_info->phy_info[i].negotiated_link_rate =
2421 port_info->phy_info[i].portinfo = port_info;
2422 port_info->phy_info[i].handle =
2491 mptsas_sas_phy_pg0(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
2542 phy_info->hw_link_rate = buffer->HwLinkRate;
2543 phy_info->programmed_link_rate = buffer->ProgrammedLinkRate;
2544 phy_info->identify.handle = le16_to_cpu(buffer->OwnerDevHandle);
2545 phy_info->attached.handle = le16_to_cpu(buffer->AttachedDevHandle);
2693 port_info->phy_info = kcalloc(port_info->num_phys,
2695 if (!port_info->phy_info) {
2702 port_info->phy_info[i].portinfo = port_info;
2703 port_info->phy_info[i].handle =
2705 port_info->phy_info[i].identify.sas_address =
2707 port_info->phy_info[i].identify.handle_parent =
2719 mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
2776 phy_info->phy_id = buffer->PhyIdentifier;
2777 phy_info->port_id = buffer->PhysicalPort;
2778 phy_info->negotiated_link_rate = buffer->NegotiatedLinkRate;
2779 phy_info->programmed_link_rate = buffer->ProgrammedLinkRate;
2780 phy_info->hw_link_rate = buffer->HwLinkRate;
2781 phy_info->identify.handle = le16_to_cpu(buffer->OwnerDevHandle);
2782 phy_info->attached.handle = le16_to_cpu(buffer->AttachedDevHandle);
3032 struct mptsas_phyinfo *phy_info, int index, int local)
3045 if (!phy_info->phy) {
3052 phy = phy_info->phy;
3054 mptsas_parse_device_info(&phy->identify, &phy_info->identify);
3059 switch (phy_info->negotiated_link_rate) {
3085 switch (phy_info->hw_link_rate & MPI_SAS_PHY0_PRATE_MAX_RATE_MASK) {
3099 switch (phy_info->programmed_link_rate &
3114 switch (phy_info->hw_link_rate & MPI_SAS_PHY0_HWRATE_MIN_RATE_MASK) {
3128 switch (phy_info->programmed_link_rate &
3140 if (!phy_info->phy) {
3147 phy_info->phy = phy;
3150 if (!phy_info->attached.handle ||
3151 !phy_info->port_details)
3154 port = mptsas_get_port(phy_info);
3155 ioc = phy_to_ioc(phy_info->phy);
3157 if (phy_info->sas_port_add_phy) {
3172 mptsas_set_port(ioc, phy_info, port);
3176 (unsigned long long)phy_info->
3181 ioc->name, phy_info->phy_id));
3182 sas_port_add_phy(port, phy_info->phy);
3183 phy_info->sas_port_add_phy = 0;
3184 devtprintk(ioc, dev_printk(KERN_DEBUG, &phy_info->phy->dev,
3186 phy_info->phy_id, phy_info->phy));
3188 if (!mptsas_get_rphy(phy_info) && port && !port->rphy) {
3200 if (mptsas_is_end_device(&phy_info->attached) &&
3201 phy_info->attached.handle_parent) {
3205 mptsas_parse_device_info(&identify, &phy_info->attached);
3213 if (port_info->phy_info[i].identify.sas_address ==
3256 mptsas_set_rphy(ioc, phy_info, rphy);
3267 phy_info->attached.channel,
3268 phy_info->attached.id);
3301 port_info->phy_info[i].negotiated_link_rate =
3302 hba->phy_info[i].negotiated_link_rate;
3303 port_info->phy_info[i].handle =
3304 hba->phy_info[i].handle;
3305 port_info->phy_info[i].port_id =
3306 hba->phy_info[i].port_id;
3308 kfree(hba->phy_info);
3317 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i],
3320 port_info->phy_info[i].identify.handle =
3321 port_info->phy_info[i].handle;
3322 mptsas_sas_device_pg0(ioc, &port_info->phy_info[i].identify,
3325 port_info->phy_info[i].identify.handle);
3328 port_info->phy_info[i].identify.sas_address;
3329 port_info->phy_info[i].identify.phy_id =
3330 port_info->phy_info[i].phy_id = i;
3331 if (port_info->phy_info[i].attached.handle)
3333 &port_info->phy_info[i].attached,
3336 port_info->phy_info[i].attached.handle);
3343 &port_info->phy_info[i], ioc->sas_index, 1);
3363 handle = port_info->phy_info[0].handle;
3364 sas_address = port_info->phy_info[0].identify.sas_address;
3366 mptsas_sas_expander_pg1(ioc, &port_info->phy_info[i],
3371 &port_info->phy_info[i].identify,
3374 port_info->phy_info[i].identify.handle);
3375 port_info->phy_info[i].identify.phy_id =
3376 port_info->phy_info[i].phy_id;
3378 if (port_info->phy_info[i].attached.handle) {
3380 &port_info->phy_info[i].attached,
3383 port_info->phy_info[i].attached.handle);
3384 port_info->phy_info[i].attached.phy_id =
3385 port_info->phy_info[i].phy_id;
3391 port_info->phy_info[0].identify.handle_parent);
3398 if (parent->phy_info[i].attached.sas_address == sas_address) {
3399 rphy = mptsas_get_rphy(&parent->phy_info[i]);
3407 mptsas_probe_one_phy(parent_dev, &port_info->phy_info[i],
3424 port_info->phy_info = kcalloc(port_info->num_phys,
3426 if (!port_info->phy_info)
3430 port_info->phy_info[i].portinfo = port_info;
3431 port_info->phy_info[i].handle =
3433 port_info->phy_info[i].identify.sas_address =
3435 port_info->phy_info[i].identify.handle_parent =
3460 struct mptsas_phyinfo *phy_info;
3465 phy_info = expander->phy_info;
3466 for (i = 0; i < expander->num_phys; i++, phy_info++) {
3467 rphy = mptsas_get_rphy(phy_info);
3471 mptsas_del_end_device(ioc, phy_info);
3474 phy_info = expander->phy_info;
3475 for (i = 0; i < expander->num_phys; i++, phy_info++) {
3476 rphy = mptsas_get_rphy(phy_info);
3514 struct mptsas_phyinfo *phy_info;
3526 port_info->phy_info[0].identify.handle);
3529 kfree(buffer.phy_info);
3540 port_info->phy_info[0].identify.sas_address;
3542 port_info->phy_info[0].identify.handle_parent);
3551 phy_info = parent->phy_info;
3553 for (i = 0; i < parent->num_phys; i++, phy_info++) {
3554 if (!phy_info->phy)
3556 if (phy_info->attached.sas_address !=
3560 port = mptsas_get_port(phy_info);
3561 port_details = phy_info->port_details;
3563 dev_printk(KERN_DEBUG, &phy_info->phy->dev,
3565 phy_info->phy_id, phy_info->phy);
3566 sas_port_delete_phy(port, phy_info->phy);
3586 kfree(port_info->phy_info);
3619 port_info->phy_info[i].portinfo = port_info;
3620 port_info->phy_info[i].handle =
3622 port_info->phy_info[i].identify.sas_address =
3624 port_info->phy_info[i].identify.handle_parent =
3663 port_info->phy_info = buffer.phy_info;
3665 port_info->phy_info[i].portinfo = port_info;
3671 (unsigned long long)buffer.phy_info[0].identify.sas_address);
3682 struct mptsas_phyinfo *phy_info = NULL;
3697 phy_info = &port_info->phy_info[phy_num];
3698 if (phy_info)
3699 phy_info->negotiated_link_rate = link_rate;
3720 } else if (phy_info && phy_info->phy) {
3722 phy_info->phy->negotiated_linkrate =
3726 phy_info->phy->negotiated_linkrate =
3729 phy_info->phy->negotiated_linkrate =
3732 mptsas_is_end_device(&phy_info->attached)) {
3736 id = phy_info->attached.id;
3737 channel = phy_info->attached.channel;
3740 ioc->name, phy_info->attached.id,
3741 phy_info->attached.channel));
3777 struct mptsas_phyinfo *phy_info;
3849 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
3852 mptsas_del_end_device(ioc, phy_info);
3864 if (!(port_info->phy_info[0].identify.device_info &
3874 handle = buffer.phy_info[0].handle;
3875 if (buffer.phy_info[0].identify.sas_address ==
3876 port_info->phy_info[0].identify.sas_address) {
3879 kfree(buffer.phy_info);
3907 handle = buffer.phy_info[0].handle;
3909 buffer.phy_info[0].identify.sas_address);
3914 port_info->phy_info[i].handle = handle;
3915 port_info->phy_info[i].identify.handle_parent =
3916 buffer.phy_info[0].identify.handle_parent;
3919 kfree(buffer.phy_info);
3931 port_info->phy_info = buffer.phy_info;
3933 port_info->phy_info[i].portinfo = port_info;
3939 (unsigned long long)buffer.phy_info[0].identify.sas_address);
3949 struct mptsas_phyinfo *phy_info;
3970 phy_info = mptsas_refreshing_device_handles(ioc, &sas_device);
3971 if (!phy_info)
3974 if (mptsas_get_rphy(phy_info))
3977 mptsas_add_end_device(ioc, phy_info);
4111 struct mptsas_phyinfo *phy_info = NULL;
4118 &port_info->phy_info[i].attached))
4120 if (port_info->phy_info[i].attached.sas_address
4123 phy_info = &port_info->phy_info[i];
4128 return phy_info;
4143 struct mptsas_phyinfo *phy_info = NULL;
4150 phy_info = NULL;
4170 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
4178 if (phy_info)
4179 return phy_info;
4187 for (i = 0; i < port_info->num_phys && !phy_info; i++) {
4189 &port_info->phy_info[i].attached))
4191 if (port_info->phy_info[i].attached.phys_disk_num == ~0)
4193 if ((port_info->phy_info[i].attached.phys_disk_num ==
4195 (port_info->phy_info[i].attached.id == id) &&
4196 (port_info->phy_info[i].attached.channel ==
4198 phy_info = &port_info->phy_info[i];
4202 return phy_info;
4230 struct mptsas_phyinfo *phy_info;
4287 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
4289 mptsas_add_end_device(ioc, phy_info);
4304 struct mptsas_phyinfo *phy_info;
4349 phy_info = mptsas_refreshing_device_handles(ioc, &sas_device);
4351 if (!phy_info) {
4369 phy_info = mptsas_refreshing_device_handles
4373 if (!phy_info) {
4380 if (mptsas_get_rphy(phy_info))
4383 mptsas_add_end_device(ioc, phy_info);
4387 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
4389 mptsas_del_end_device(ioc, phy_info);
4396 phy_info = mptsas_find_phyinfo_by_phys_disk_num(
4400 mptsas_del_end_device(ioc, phy_info);
4422 phy_info = mptsas_find_phyinfo_by_sas_address(
4425 if (!phy_info) {
4432 starget = mptsas_get_starget(phy_info);
4458 phy_info->attached.phys_disk_num = hot_plug_info->phys_disk_num;
4482 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
4484 if (!phy_info) {
4491 starget = mptsas_get_starget(phy_info);
4524 phy_info->attached.phys_disk_num = ~0;
5345 mptsas_port_delete(ioc, p->phy_info[i].port_details);
5347 kfree(p->phy_info);