• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/scsi/qla2xxx/

Lines Matching defs:fcport

1734 	fc_port_t *fcport = data;
1738 spin_lock_irqsave(&fcport->rport_lock, flags);
1739 rport = fcport->drport;
1740 fcport->drport = NULL;
1741 spin_unlock_irqrestore(&fcport->rport_lock, flags);
1748 * qla2x00_alloc_fcport() - Allocate a generic fcport.
1752 * Returns a pointer to the allocated fcport, or NULL, if none available.
1757 fc_port_t *fcport;
1759 fcport = kmalloc(sizeof(fc_port_t), flags);
1760 if (fcport == NULL)
1761 return (fcport);
1763 /* Setup fcport template structure. */
1764 memset(fcport, 0, sizeof (fc_port_t));
1765 fcport->ha = ha;
1766 fcport->port_type = FCT_UNKNOWN;
1767 fcport->loop_id = FC_NO_LOOP_ID;
1768 atomic_set(&fcport->state, FCS_UNCONFIGURED);
1769 fcport->flags = FCF_RLC_SUPPORT;
1770 fcport->supported_classes = FC_COS_UNSPECIFIED;
1771 spin_lock_init(&fcport->rport_lock);
1773 return (fcport);
1905 fc_port_t *fcport, *new_fcport;
1932 /* Allocate temporary fcport for any new fcports discovered. */
1943 list_for_each_entry(fcport, &ha->fcports, list) {
1944 if (atomic_read(&fcport->state) == FCS_ONLINE &&
1945 fcport->port_type != FCT_BROADCAST &&
1946 (fcport->flags & FCF_FABRIC_DEVICE) == 0) {
1950 ha->host_no, fcport->loop_id));
1952 atomic_set(&fcport->state, FCS_DEVICE_LOST);
1953 fcport->flags &= ~FCF_FARP_DONE;
1991 DEBUG2(printk("scsi(%ld): Failed to retrieve fcport "
2003 fcport = NULL;
2004 list_for_each_entry(fcport, &ha->fcports, list) {
2005 if (memcmp(new_fcport->port_name, fcport->port_name,
2009 fcport->flags &= ~(FCF_FABRIC_DEVICE |
2011 fcport->loop_id = new_fcport->loop_id;
2012 fcport->port_type = new_fcport->port_type;
2013 fcport->d_id.b24 = new_fcport->d_id.b24;
2014 memcpy(fcport->node_name, new_fcport->node_name,
2026 /* Allocate a new replacement fcport. */
2027 fcport = new_fcport;
2039 fcport->fp_speed = cpu_to_be16(BIT_15);
2042 fcport->fp_speed = cpu_to_be16(BIT_14);
2045 fcport->fp_speed = cpu_to_be16(BIT_13);
2049 qla2x00_update_fcport(ha, fcport);
2073 fc_port_t *fcport;
2076 list_for_each_entry(fcport, &ha->fcports, list) {
2077 if (fcport->port_type != FCT_TARGET)
2080 qla2x00_update_fcport(ha, fcport);
2085 qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
2095 switch (be16_to_cpu(fcport->fp_speed)) {
2108 ha->host_no, fcport->port_name[0], fcport->port_name[1],
2109 fcport->port_name[2], fcport->port_name[3],
2110 fcport->port_name[4], fcport->port_name[5],
2111 fcport->port_name[6], fcport->port_name[7],
2112 be16_to_cpu(fcport->fp_speed)));
2119 rval = qla2x00_set_idma_speed(ha, fcport->loop_id, port_speed, mb);
2123 ha->host_no, fcport->port_name[0], fcport->port_name[1],
2124 fcport->port_name[2], fcport->port_name[3],
2125 fcport->port_name[4], fcport->port_name[5],
2126 fcport->port_name[6], fcport->port_name[7], rval,
2132 link_speeds[port_speed], fcport->port_name[0],
2133 fcport->port_name[1], fcport->port_name[2],
2134 fcport->port_name[3], fcport->port_name[4],
2135 fcport->port_name[5], fcport->port_name[6],
2136 fcport->port_name[7]));
2141 qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport)
2147 if (fcport->drport)
2148 qla2x00_rport_del(fcport);
2149 if (fcport->rport)
2152 rport_ids.node_name = wwn_to_u64(fcport->node_name);
2153 rport_ids.port_name = wwn_to_u64(fcport->port_name);
2154 rport_ids.port_id = fcport->d_id.b.domain << 16 |
2155 fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa;
2163 spin_lock_irqsave(&fcport->rport_lock, flags);
2164 fcport->rport = rport;
2165 *((fc_port_t **)rport->dd_data) = fcport;
2166 spin_unlock_irqrestore(&fcport->rport_lock, flags);
2168 rport->supported_classes = fcport->supported_classes;
2171 if (fcport->port_type == FCT_INITIATOR)
2173 if (fcport->port_type == FCT_TARGET)
2179 fcport->os_target_id = rport->scsi_target_id;
2188 * fcport = port structure pointer.
2198 qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
2200 fcport->ha = ha;
2201 fcport->login_retry = 0;
2202 fcport->port_login_retry_count = ha->port_down_retry_count *
2204 atomic_set(&fcport->port_down_timer, ha->port_down_retry_count *
2206 fcport->flags &= ~FCF_LOGIN_NEEDED;
2208 qla2x00_iidma_fcport(ha, fcport);
2210 atomic_set(&fcport->state, FCS_ONLINE);
2212 qla2x00_reg_remote_port(ha, fcport);
2230 fc_port_t *fcport, *fcptemp;
2308 list_for_each_entry(fcport, &ha->fcports, list) {
2312 if ((fcport->flags & FCF_FABRIC_DEVICE) == 0)
2315 if (atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
2316 qla2x00_mark_device_lost(ha, fcport,
2318 if (fcport->loop_id != FC_NO_LOOP_ID &&
2319 (fcport->flags & FCF_TAPE_PRESENT) == 0 &&
2320 fcport->port_type != FCT_INITIATOR &&
2321 fcport->port_type != FCT_BROADCAST) {
2323 fcport->loop_id,
2324 fcport->d_id.b.domain,
2325 fcport->d_id.b.area,
2326 fcport->d_id.b.al_pa);
2327 fcport->loop_id = FC_NO_LOOP_ID;
2339 list_for_each_entry(fcport, &ha->fcports, list) {
2344 if ((fcport->flags & FCF_FABRIC_DEVICE) == 0 ||
2345 (fcport->flags & FCF_LOGIN_NEEDED) == 0)
2348 if (fcport->loop_id == FC_NO_LOOP_ID) {
2349 fcport->loop_id = next_loopid;
2350 rval = qla2x00_find_new_loop_id(ha, fcport);
2357 qla2x00_fabric_dev_login(ha, fcport, &next_loopid);
2368 list_for_each_entry_safe(fcport, fcptemp, &new_fcports, list) {
2374 fcport->loop_id = next_loopid;
2375 rval = qla2x00_find_new_loop_id(ha, fcport);
2382 list_move_tail(&fcport->list, &ha->fcports);
2385 qla2x00_fabric_dev_login(ha, fcport, &next_loopid);
2390 list_for_each_entry_safe(fcport, fcptemp, &new_fcports, list) {
2391 list_del(&fcport->list);
2392 kfree(fcport);
2422 fc_port_t *fcport, *new_fcport, *fcptemp;
2455 /* Allocate temporary fcport for any new fcports discovered. */
2501 list_for_each_entry_safe(fcport, fcptemp,
2503 list_del(&fcport->list);
2504 kfree(fcport);
2538 list_for_each_entry(fcport, &ha->fcports, list) {
2539 if (memcmp(new_fcport->port_name, fcport->port_name,
2546 memcpy(fcport->fabric_port_name,
2548 fcport->fp_speed = new_fcport->fp_speed;
2554 if (fcport->d_id.b24 == new_fcport->d_id.b24 &&
2555 atomic_read(&fcport->state) == FCS_ONLINE) {
2562 if ((fcport->flags & FCF_FABRIC_DEVICE) == 0) {
2563 fcport->d_id.b24 = new_fcport->d_id.b24;
2564 fcport->loop_id = FC_NO_LOOP_ID;
2565 fcport->flags |= (FCF_FABRIC_DEVICE |
2567 fcport->flags &= ~FCF_PERSISTENT_BOUND;
2576 fcport->d_id.b24 = new_fcport->d_id.b24;
2577 fcport->flags |= FCF_LOGIN_NEEDED;
2578 if (fcport->loop_id != FC_NO_LOOP_ID &&
2579 (fcport->flags & FCF_TAPE_PRESENT) == 0 &&
2580 fcport->port_type != FCT_INITIATOR &&
2581 fcport->port_type != FCT_BROADCAST) {
2582 ha->isp_ops.fabric_logout(ha, fcport->loop_id,
2583 fcport->d_id.b.domain, fcport->d_id.b.area,
2584 fcport->d_id.b.al_pa);
2585 fcport->loop_id = FC_NO_LOOP_ID;
2597 /* Allocate a new replacement fcport. */
2636 fc_port_t *fcport;
2663 fcport = NULL;
2664 list_for_each_entry(fcport, &ha->fcports, list) {
2665 if (fcport->loop_id == dev->loop_id && fcport != dev) {
2706 fc_port_t *fcport;
2777 list_for_each_entry(fcport, &ha->fcports, list) {
2778 if ((fcport->flags & FCF_FABRIC_DEVICE) == 0 ||
2779 (fcport->d_id.b24 & mask) != d_id.b24 ||
2780 fcport->port_type == FCT_BROADCAST)
2783 if (atomic_read(&fcport->state) == FCS_ONLINE) {
2785 fcport->port_type != FCT_INITIATOR) {
2786 qla2x00_mark_device_lost(ha, fcport,
2790 fcport->flags &= ~FCF_FARP_DONE;
2802 * fcport: port structure list pointer.
2813 qla2x00_fabric_dev_login(scsi_qla_host_t *ha, fc_port_t *fcport,
2823 rval = qla2x00_fabric_login(ha, fcport, next_loopid);
2827 if (fcport->flags & FCF_TAPE_PRESENT)
2829 rval = qla2x00_get_port_database(ha, fcport, opts);
2831 ha->isp_ops.fabric_logout(ha, fcport->loop_id,
2832 fcport->d_id.b.domain, fcport->d_id.b.area,
2833 fcport->d_id.b.al_pa);
2834 qla2x00_mark_device_lost(ha, fcport, 1, 0);
2836 qla2x00_update_fcport(ha, fcport);
2858 qla2x00_fabric_login(scsi_qla_host_t *ha, fc_port_t *fcport,
2872 ha->host_no, fcport->loop_id, fcport->d_id.b.domain,
2873 fcport->d_id.b.area, fcport->d_id.b.al_pa));
2875 /* Login fcport on switch. */
2876 ha->isp_ops.fabric_login(ha, fcport->loop_id,
2877 fcport->d_id.b.domain, fcport->d_id.b.area,
2878 fcport->d_id.b.al_pa, mb, BIT_0);
2888 tmp_loopid = fcport->loop_id;
2889 fcport->loop_id = mb[1];
2893 fcport->loop_id, fcport->d_id.b.domain,
2894 fcport->d_id.b.area, fcport->d_id.b.al_pa));
2908 *next_loopid = (fcport->loop_id + 1);
2912 fcport->port_type = FCT_INITIATOR;
2914 fcport->port_type = FCT_TARGET;
2916 fcport->flags |= FCF_TAPE_PRESENT;
2921 fcport->supported_classes |= FC_COS_CLASS2;
2923 fcport->supported_classes |= FC_COS_CLASS3;
2931 fcport->loop_id++;
2932 rval = qla2x00_find_new_loop_id(ha, fcport);
2943 *next_loopid = fcport->loop_id;
2944 ha->isp_ops.fabric_logout(ha, fcport->loop_id,
2945 fcport->d_id.b.domain, fcport->d_id.b.area,
2946 fcport->d_id.b.al_pa);
2947 qla2x00_mark_device_lost(ha, fcport, 1, 0);
2958 fcport->d_id.b.domain, fcport->d_id.b.area,
2959 fcport->d_id.b.al_pa, fcport->loop_id, jiffies));
2961 *next_loopid = fcport->loop_id;
2962 ha->isp_ops.fabric_logout(ha, fcport->loop_id,
2963 fcport->d_id.b.domain, fcport->d_id.b.area,
2964 fcport->d_id.b.al_pa);
2965 fcport->loop_id = FC_NO_LOOP_ID;
2966 fcport->login_retry = 0;
2990 qla2x00_local_device_login(scsi_qla_host_t *ha, fc_port_t *fcport)
2996 rval = qla2x00_login_local_device(ha, fcport, mb, BIT_0);
3067 fc_port_t *fcport;
3070 list_for_each_entry(fcport, &ha->fcports, list) {
3071 if ((fcport->flags & FCF_RESCAN_NEEDED) == 0)
3074 qla2x00_update_fcport(ha, fcport);
3075 fcport->flags &= ~FCF_RESCAN_NEEDED;
3085 fc_port_t *fcport;
3088 list_for_each_entry(fcport, &ha->fcports, list)
3089 if (fcport->drport)
3090 qla2x00_rport_del(fcport);