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);
414 if (port_info->phy_info[i].identify.handle == handle) {
446 if (port_info->phy_info[i].identify.sas_address ==
481 struct mptsas_phyinfo *phy_info;
488 phy_info = port_info->phy_info;
495 for (i = 0; i < port_info->num_phys; i++, phy_info++) {
496 if(phy_info->port_details != port_details)
498 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
499 mptsas_set_rphy(ioc, phy_info, NULL);
500 phy_info->port_details = NULL;
506 mptsas_get_rphy(struct mptsas_phyinfo *phy_info)
508 if (phy_info->port_details)
509 return phy_info->port_details->rphy;
515 mptsas_set_rphy(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, struct sas_rphy *rphy)
517 if (phy_info->port_details) {
518 phy_info->port_details->rphy = rphy;
532 mptsas_get_port(struct mptsas_phyinfo *phy_info)
534 if (phy_info->port_details)
535 return phy_info->port_details->port;
541 mptsas_set_port(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, struct sas_port *port)
543 if (phy_info->port_details)
544 phy_info->port_details->port = port;
555 mptsas_get_starget(struct mptsas_phyinfo *phy_info)
557 if (phy_info->port_details)
558 return phy_info->port_details->starget;
564 mptsas_set_starget(struct mptsas_phyinfo *phy_info, struct scsi_target *
567 if (phy_info->port_details)
568 phy_info->port_details->starget = starget;
787 struct mptsas_phyinfo *phy_info = NULL;
791 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
793 if (!phy_info)
800 phy_info->attached.handle_enclosure);
802 mptsas_add_device_component(ioc, phy_info->attached.channel,
803 phy_info->attached.id, phy_info->attached.sas_address,
804 phy_info->attached.device_info,
805 phy_info->attached.slot, enclosure_info.enclosure_logical_id);
860 struct mptsas_phyinfo *phy_info, *phy_info_cmp;
866 phy_info = port_info->phy_info;
867 for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) {
868 if (phy_info->attached.handle)
870 port_details = phy_info->port_details;
883 port_details->phy_bitmask &= ~ (1 << phy_info->phy_id);
884 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
885 if (phy_info->phy) {
887 &phy_info->phy->dev, MYIOC_s_FMT
889 phy_info->phy_id, phy_info->phy));
890 sas_port_delete_phy(port_details->port, phy_info->phy);
892 phy_info->port_details = NULL;
898 phy_info = port_info->phy_info;
899 for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) {
900 sas_address = phy_info->attached.sas_address;
905 port_details = phy_info->port_details;
916 if (phy_info->phy_id < 64 )
918 (1 << phy_info->phy_id);
919 phy_info->sas_port_add_phy=1;
923 phy_info->port_details = port_details;
928 phy_info_cmp = &port_info->phy_info[i + 1];
968 port_details = port_info->phy_info[i].port_details;
1438 * @phy_info: describes attached device
1444 mptsas_add_end_device(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info)
1452 if (!phy_info) {
1459 fw_id = phy_info->attached.id;
1461 if (mptsas_get_rphy(phy_info)) {
1468 port = mptsas_get_port(phy_info);
1476 if (phy_info->attached.device_info &
1479 if (phy_info->attached.device_info &
1482 if (phy_info->attached.device_info &
1488 phy_info->attached.channel, phy_info->attached.id,
1489 phy_info->attached.phy_id, (unsigned long long)
1490 phy_info->attached.sas_address);
1492 mptsas_parse_device_info(&identify, &phy_info->attached);
1509 mptsas_set_rphy(ioc, phy_info, rphy);
1516 * @phy_info: describes attached device
1520 mptsas_del_end_device(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info)
1531 if (!phy_info)
1534 fw_id = phy_info->attached.id;
1535 sas_address = phy_info->attached.sas_address;
1537 if (!phy_info->port_details) {
1543 rphy = mptsas_get_rphy(phy_info);
1551 if (phy_info->attached.device_info & MPI_SAS_DEVICE_INFO_SSP_INITIATOR
1552 || phy_info->attached.device_info
1554 || phy_info->attached.device_info
1557 if (phy_info->attached.device_info &
1560 if (phy_info->attached.device_info &
1563 if (phy_info->attached.device_info &
1569 "sas_addr 0x%llx\n", ioc->name, ds, phy_info->attached.channel,
1570 phy_info->attached.id, phy_info->attached.phy_id,
1573 port = mptsas_get_port(phy_info);
1580 port_info = phy_info->portinfo;
1581 phy_info_parent = port_info->phy_info;
1599 mptsas_set_port(ioc, phy_info, NULL);
1600 mptsas_port_delete(ioc, phy_info->port_details);
1607 struct mptsas_phyinfo *phy_info;
1611 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
1613 if (!phy_info)
1615 port_info = phy_info->portinfo;
1620 if (port_info->phy_info[i].attached.sas_address !=
1623 port_info->phy_info[i].attached.channel = sas_device->channel;
1624 port_info->phy_info[i].attached.id = sas_device->id;
1625 port_info->phy_info[i].attached.sas_address =
1627 port_info->phy_info[i].attached.handle = sas_device->handle;
1628 port_info->phy_info[i].attached.handle_parent =
1630 port_info->phy_info[i].attached.handle_enclosure =
1635 return phy_info;
1787 if (p->phy_info[i].attached.sas_address !=
1790 id = p->phy_info[i].attached.id;
1791 channel = p->phy_info[i].attached.channel;
1792 mptsas_set_starget(&p->phy_info[i], starget);
1802 p->phy_info[i].attached.phys_disk_num = id;
1846 if (p->phy_info[i].attached.sas_address !=
1853 p->phy_info[i].attached.channel,
1854 p->phy_info[i].attached.id,
1855 p->phy_info[i].attached.phy_id, (unsigned long long)
1856 p->phy_info[i].attached.sas_address);
1858 mptsas_set_starget(&p->phy_info[i], NULL);
1897 if (p->phy_info[i].attached.sas_address !=
1905 p->phy_info[i].attached.channel,
1906 p->phy_info[i].attached.id))
2195 if (p->phy_info[i].attached.sas_address ==
2197 enclosure_handle = p->phy_info[i].
2227 if (p->phy_info[i].attached.sas_address ==
2229 rc = p->phy_info[i].attached.slot;
2286 if (port_info && port_info->phy_info)
2288 port_info->phy_info[0].phy->identify.sas_address;
2430 port_info->phy_info = kcalloc(port_info->num_phys,
2432 if (!port_info->phy_info) {
2444 port_info->phy_info[i].phy_id = i;
2445 port_info->phy_info[i].port_id =
2447 port_info->phy_info[i].negotiated_link_rate =
2449 port_info->phy_info[i].portinfo = port_info;
2450 port_info->phy_info[i].handle =
2519 mptsas_sas_phy_pg0(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
2570 phy_info->hw_link_rate = buffer->HwLinkRate;
2571 phy_info->programmed_link_rate = buffer->ProgrammedLinkRate;
2572 phy_info->identify.handle = le16_to_cpu(buffer->OwnerDevHandle);
2573 phy_info->attached.handle = le16_to_cpu(buffer->AttachedDevHandle);
2721 port_info->phy_info = kcalloc(port_info->num_phys,
2723 if (!port_info->phy_info) {
2730 port_info->phy_info[i].portinfo = port_info;
2731 port_info->phy_info[i].handle =
2733 port_info->phy_info[i].identify.sas_address =
2735 port_info->phy_info[i].identify.handle_parent =
2747 mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
2804 phy_info->phy_id = buffer->PhyIdentifier;
2805 phy_info->port_id = buffer->PhysicalPort;
2806 phy_info->negotiated_link_rate = buffer->NegotiatedLinkRate;
2807 phy_info->programmed_link_rate = buffer->ProgrammedLinkRate;
2808 phy_info->hw_link_rate = buffer->HwLinkRate;
2809 phy_info->identify.handle = le16_to_cpu(buffer->OwnerDevHandle);
2810 phy_info->attached.handle = le16_to_cpu(buffer->AttachedDevHandle);
3063 struct mptsas_phyinfo *phy_info, int index, int local)
3076 if (!phy_info->phy) {
3083 phy = phy_info->phy;
3085 mptsas_parse_device_info(&phy->identify, &phy_info->identify);
3090 switch (phy_info->negotiated_link_rate) {
3116 switch (phy_info->hw_link_rate & MPI_SAS_PHY0_PRATE_MAX_RATE_MASK) {
3130 switch (phy_info->programmed_link_rate &
3145 switch (phy_info->hw_link_rate & MPI_SAS_PHY0_HWRATE_MIN_RATE_MASK) {
3159 switch (phy_info->programmed_link_rate &
3171 if (!phy_info->phy) {
3178 phy_info->phy = phy;
3181 if (!phy_info->attached.handle ||
3182 !phy_info->port_details)
3185 port = mptsas_get_port(phy_info);
3186 ioc = phy_to_ioc(phy_info->phy);
3188 if (phy_info->sas_port_add_phy) {
3203 mptsas_set_port(ioc, phy_info, port);
3207 (unsigned long long)phy_info->
3212 ioc->name, phy_info->phy_id));
3213 sas_port_add_phy(port, phy_info->phy);
3214 phy_info->sas_port_add_phy = 0;
3215 devtprintk(ioc, dev_printk(KERN_DEBUG, &phy_info->phy->dev,
3217 phy_info->phy_id, phy_info->phy));
3219 if (!mptsas_get_rphy(phy_info) && port && !port->rphy) {
3231 if (mptsas_is_end_device(&phy_info->attached) &&
3232 phy_info->attached.handle_parent) {
3236 mptsas_parse_device_info(&identify, &phy_info->attached);
3244 if (port_info->phy_info[i].identify.sas_address ==
3287 mptsas_set_rphy(ioc, phy_info, rphy);
3298 phy_info->attached.channel,
3299 phy_info->attached.id);
3332 port_info->phy_info[i].negotiated_link_rate =
3333 hba->phy_info[i].negotiated_link_rate;
3334 port_info->phy_info[i].handle =
3335 hba->phy_info[i].handle;
3336 port_info->phy_info[i].port_id =
3337 hba->phy_info[i].port_id;
3339 kfree(hba->phy_info);
3348 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i],
3351 port_info->phy_info[i].identify.handle =
3352 port_info->phy_info[i].handle;
3353 mptsas_sas_device_pg0(ioc, &port_info->phy_info[i].identify,
3356 port_info->phy_info[i].identify.handle);
3359 port_info->phy_info[i].identify.sas_address;
3360 port_info->phy_info[i].identify.phy_id =
3361 port_info->phy_info[i].phy_id = i;
3362 if (port_info->phy_info[i].attached.handle)
3364 &port_info->phy_info[i].attached,
3367 port_info->phy_info[i].attached.handle);
3374 &port_info->phy_info[i], ioc->sas_index, 1);
3394 handle = port_info->phy_info[0].handle;
3395 sas_address = port_info->phy_info[0].identify.sas_address;
3397 mptsas_sas_expander_pg1(ioc, &port_info->phy_info[i],
3402 &port_info->phy_info[i].identify,
3405 port_info->phy_info[i].identify.handle);
3406 port_info->phy_info[i].identify.phy_id =
3407 port_info->phy_info[i].phy_id;
3409 if (port_info->phy_info[i].attached.handle) {
3411 &port_info->phy_info[i].attached,
3414 port_info->phy_info[i].attached.handle);
3415 port_info->phy_info[i].attached.phy_id =
3416 port_info->phy_info[i].phy_id;
3422 port_info->phy_info[0].identify.handle_parent);
3429 if (parent->phy_info[i].attached.sas_address == sas_address) {
3430 rphy = mptsas_get_rphy(&parent->phy_info[i]);
3438 mptsas_probe_one_phy(parent_dev, &port_info->phy_info[i],
3454 port_info->phy_info = kcalloc(port_info->num_phys,
3456 BUG_ON(!port_info->phy_info);
3459 port_info->phy_info[i].portinfo = port_info;
3460 port_info->phy_info[i].handle =
3462 port_info->phy_info[i].identify.sas_address =
3464 port_info->phy_info[i].identify.handle_parent =
3489 struct mptsas_phyinfo *phy_info;
3494 phy_info = expander->phy_info;
3495 for (i = 0; i < expander->num_phys; i++, phy_info++) {
3496 rphy = mptsas_get_rphy(phy_info);
3500 mptsas_del_end_device(ioc, phy_info);
3503 phy_info = expander->phy_info;
3504 for (i = 0; i < expander->num_phys; i++, phy_info++) {
3505 rphy = mptsas_get_rphy(phy_info);
3543 struct mptsas_phyinfo *phy_info;
3555 port_info->phy_info[0].identify.handle);
3558 kfree(buffer.phy_info);
3569 port_info->phy_info[0].identify.sas_address;
3571 port_info->phy_info[0].identify.handle_parent);
3580 phy_info = parent->phy_info;
3582 for (i = 0; i < parent->num_phys; i++, phy_info++) {
3583 if (!phy_info->phy)
3585 if (phy_info->attached.sas_address !=
3589 port = mptsas_get_port(phy_info);
3590 port_details = phy_info->port_details;
3592 dev_printk(KERN_DEBUG, &phy_info->phy->dev,
3594 phy_info->phy_id, phy_info->phy);
3595 sas_port_delete_phy(port, phy_info->phy);
3615 kfree(port_info->phy_info);
3647 port_info->phy_info[i].portinfo = port_info;
3648 port_info->phy_info[i].handle =
3650 port_info->phy_info[i].identify.sas_address =
3652 port_info->phy_info[i].identify.handle_parent =
3691 port_info->phy_info = buffer.phy_info;
3693 port_info->phy_info[i].portinfo = port_info;
3699 (unsigned long long)buffer.phy_info[0].identify.sas_address);
3710 struct mptsas_phyinfo *phy_info = NULL;
3725 phy_info = &port_info->phy_info[phy_num];
3726 if (phy_info)
3727 phy_info->negotiated_link_rate = link_rate;
3748 } else if (phy_info && phy_info->phy) {
3750 phy_info->phy->negotiated_linkrate =
3754 phy_info->phy->negotiated_linkrate =
3757 phy_info->phy->negotiated_linkrate =
3760 mptsas_is_end_device(&phy_info->attached)) {
3764 id = phy_info->attached.id;
3765 channel = phy_info->attached.channel;
3768 ioc->name, phy_info->attached.id,
3769 phy_info->attached.channel));
3805 struct mptsas_phyinfo *phy_info;
3877 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
3880 mptsas_del_end_device(ioc, phy_info);
3892 if (!(port_info->phy_info[0].identify.device_info &
3902 handle = buffer.phy_info[0].handle;
3903 if (buffer.phy_info[0].identify.sas_address ==
3904 port_info->phy_info[0].identify.sas_address) {
3907 kfree(buffer.phy_info);
3935 handle = buffer.phy_info[0].handle;
3937 buffer.phy_info[0].identify.sas_address);
3942 port_info->phy_info[i].handle = handle;
3943 port_info->phy_info[i].identify.handle_parent =
3944 buffer.phy_info[0].identify.handle_parent;
3947 kfree(buffer.phy_info);
3959 port_info->phy_info = buffer.phy_info;
3961 port_info->phy_info[i].portinfo = port_info;
3967 (unsigned long long)buffer.phy_info[0].identify.sas_address);
3977 struct mptsas_phyinfo *phy_info;
3998 phy_info = mptsas_refreshing_device_handles(ioc, &sas_device);
3999 if (!phy_info)
4002 if (mptsas_get_rphy(phy_info))
4005 mptsas_add_end_device(ioc, phy_info);
4139 struct mptsas_phyinfo *phy_info = NULL;
4146 &port_info->phy_info[i].attached))
4148 if (port_info->phy_info[i].attached.sas_address
4151 phy_info = &port_info->phy_info[i];
4156 return phy_info;
4172 struct mptsas_phyinfo *phy_info = NULL;
4179 phy_info = NULL;
4199 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
4207 if (phy_info)
4208 return phy_info;
4216 for (i = 0; i < port_info->num_phys && !phy_info; i++) {
4218 &port_info->phy_info[i].attached))
4220 if (port_info->phy_info[i].attached.phys_disk_num == ~0)
4222 if ((port_info->phy_info[i].attached.phys_disk_num ==
4224 (port_info->phy_info[i].attached.id == id) &&
4225 (port_info->phy_info[i].attached.channel ==
4227 phy_info = &port_info->phy_info[i];
4231 return phy_info;
4259 struct mptsas_phyinfo *phy_info;
4316 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
4318 mptsas_add_end_device(ioc, phy_info);
4333 struct mptsas_phyinfo *phy_info;
4378 phy_info = mptsas_refreshing_device_handles(ioc, &sas_device);
4380 if (!phy_info) {
4398 phy_info = mptsas_refreshing_device_handles
4402 if (!phy_info) {
4409 if (mptsas_get_rphy(phy_info))
4412 mptsas_add_end_device(ioc, phy_info);
4416 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
4418 mptsas_del_end_device(ioc, phy_info);
4425 phy_info = mptsas_find_phyinfo_by_phys_disk_num(
4429 mptsas_del_end_device(ioc, phy_info);
4451 phy_info = mptsas_find_phyinfo_by_sas_address(
4454 if (!phy_info) {
4461 starget = mptsas_get_starget(phy_info);
4487 phy_info->attached.phys_disk_num = hot_plug_info->phys_disk_num;
4511 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
4513 if (!phy_info) {
4520 starget = mptsas_get_starget(phy_info);
4553 phy_info->attached.phys_disk_num = ~0;
5375 mptsas_port_delete(ioc, p->phy_info[i].port_details);
5377 kfree(p->phy_info);