diff options
author | Robert Love <robert.w.love@intel.com> | 2009-06-10 18:31:10 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-21 12:07:08 -0400 |
commit | 7414705ea4aef9ce438e547f3138a680d2d1096c (patch) | |
tree | c8c14a80e31dbecbd6a9d083369f3e5e11105756 /drivers/scsi/libfc/fc_lport.c | |
parent | 650bd12b9e31ec51d7ad0df3c4f94d863b827976 (diff) |
libfc: Add runtime debugging with debug_logging module parameter
This patch adds the /sys/module/libfc/parameters/debug_logging
file to sysfs as a module parameter. It accepts an integer
bitmask for logging. Currently it supports:
bit
LSB 0 = general libfc debugging
1 = lport debugging
2 = disc debugging
3 = rport debugging
4 = fcp debugging
5 = EM debugging
6 = exch/seq debugging
7 = scsi logging (mostly error handling)
the other bits are not used at this time.
The patch converts all of the libfc source files to use
these new macros and removes the old FC_DBG macro.
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/libfc/fc_lport.c')
-rw-r--r-- | drivers/scsi/libfc/fc_lport.c | 156 |
1 files changed, 75 insertions, 81 deletions
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index e0c247724d2b..745fa5555d6a 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c | |||
@@ -101,14 +101,6 @@ | |||
101 | 101 | ||
102 | #define DNS_DELAY 3 /* Discovery delay after RSCN (in seconds)*/ | 102 | #define DNS_DELAY 3 /* Discovery delay after RSCN (in seconds)*/ |
103 | 103 | ||
104 | static int fc_lport_debug; | ||
105 | |||
106 | #define FC_DEBUG_LPORT(fmt...) \ | ||
107 | do { \ | ||
108 | if (fc_lport_debug) \ | ||
109 | FC_DBG(fmt); \ | ||
110 | } while (0) | ||
111 | |||
112 | static void fc_lport_error(struct fc_lport *, struct fc_frame *); | 104 | static void fc_lport_error(struct fc_lport *, struct fc_frame *); |
113 | 105 | ||
114 | static void fc_lport_enter_reset(struct fc_lport *); | 106 | static void fc_lport_enter_reset(struct fc_lport *); |
@@ -151,8 +143,8 @@ static void fc_lport_rport_callback(struct fc_lport *lport, | |||
151 | struct fc_rport *rport, | 143 | struct fc_rport *rport, |
152 | enum fc_rport_event event) | 144 | enum fc_rport_event event) |
153 | { | 145 | { |
154 | FC_DEBUG_LPORT("Received a %d event for port (%6x)\n", event, | 146 | FC_LPORT_DBG(lport, "Received a %d event for port (%6x)\n", event, |
155 | rport->port_id); | 147 | rport->port_id); |
156 | 148 | ||
157 | switch (event) { | 149 | switch (event) { |
158 | case RPORT_EV_CREATED: | 150 | case RPORT_EV_CREATED: |
@@ -162,19 +154,19 @@ static void fc_lport_rport_callback(struct fc_lport *lport, | |||
162 | lport->dns_rp = rport; | 154 | lport->dns_rp = rport; |
163 | fc_lport_enter_rpn_id(lport); | 155 | fc_lport_enter_rpn_id(lport); |
164 | } else { | 156 | } else { |
165 | FC_DEBUG_LPORT("Received an CREATED event on " | 157 | FC_LPORT_DBG(lport, "Received an CREATED event " |
166 | "port (%6x) for the directory " | 158 | "on port (%6x) for the directory " |
167 | "server, but the lport is not " | 159 | "server, but the lport is not " |
168 | "in the DNS state, it's in the " | 160 | "in the DNS state, it's in the " |
169 | "%d state", rport->port_id, | 161 | "%d state", rport->port_id, |
170 | lport->state); | 162 | lport->state); |
171 | lport->tt.rport_logoff(rport); | 163 | lport->tt.rport_logoff(rport); |
172 | } | 164 | } |
173 | mutex_unlock(&lport->lp_mutex); | 165 | mutex_unlock(&lport->lp_mutex); |
174 | } else | 166 | } else |
175 | FC_DEBUG_LPORT("Received an event for port (%6x) " | 167 | FC_LPORT_DBG(lport, "Received an event for port (%6x) " |
176 | "which is not the directory server\n", | 168 | "which is not the directory server\n", |
177 | rport->port_id); | 169 | rport->port_id); |
178 | break; | 170 | break; |
179 | case RPORT_EV_LOGO: | 171 | case RPORT_EV_LOGO: |
180 | case RPORT_EV_FAILED: | 172 | case RPORT_EV_FAILED: |
@@ -185,9 +177,9 @@ static void fc_lport_rport_callback(struct fc_lport *lport, | |||
185 | mutex_unlock(&lport->lp_mutex); | 177 | mutex_unlock(&lport->lp_mutex); |
186 | 178 | ||
187 | } else | 179 | } else |
188 | FC_DEBUG_LPORT("Received an event for port (%6x) " | 180 | FC_LPORT_DBG(lport, "Received an event for port (%6x) " |
189 | "which is not the directory server\n", | 181 | "which is not the directory server\n", |
190 | rport->port_id); | 182 | rport->port_id); |
191 | break; | 183 | break; |
192 | case RPORT_EV_NONE: | 184 | case RPORT_EV_NONE: |
193 | break; | 185 | break; |
@@ -363,8 +355,8 @@ static void fc_lport_add_fc4_type(struct fc_lport *lport, enum fc_fh_type type) | |||
363 | static void fc_lport_recv_rlir_req(struct fc_seq *sp, struct fc_frame *fp, | 355 | static void fc_lport_recv_rlir_req(struct fc_seq *sp, struct fc_frame *fp, |
364 | struct fc_lport *lport) | 356 | struct fc_lport *lport) |
365 | { | 357 | { |
366 | FC_DEBUG_LPORT("Received RLIR request while in state %s\n", | 358 | FC_LPORT_DBG(lport, "Received RLIR request while in state %s\n", |
367 | fc_lport_state(lport)); | 359 | fc_lport_state(lport)); |
368 | 360 | ||
369 | lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL); | 361 | lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL); |
370 | fc_frame_free(fp); | 362 | fc_frame_free(fp); |
@@ -389,8 +381,8 @@ static void fc_lport_recv_echo_req(struct fc_seq *sp, struct fc_frame *in_fp, | |||
389 | void *dp; | 381 | void *dp; |
390 | u32 f_ctl; | 382 | u32 f_ctl; |
391 | 383 | ||
392 | FC_DEBUG_LPORT("Received RLIR request while in state %s\n", | 384 | FC_LPORT_DBG(lport, "Received RLIR request while in state %s\n", |
393 | fc_lport_state(lport)); | 385 | fc_lport_state(lport)); |
394 | 386 | ||
395 | len = fr_len(in_fp) - sizeof(struct fc_frame_header); | 387 | len = fr_len(in_fp) - sizeof(struct fc_frame_header); |
396 | pp = fc_frame_payload_get(in_fp, len); | 388 | pp = fc_frame_payload_get(in_fp, len); |
@@ -437,8 +429,8 @@ static void fc_lport_recv_rnid_req(struct fc_seq *sp, struct fc_frame *in_fp, | |||
437 | size_t len; | 429 | size_t len; |
438 | u32 f_ctl; | 430 | u32 f_ctl; |
439 | 431 | ||
440 | FC_DEBUG_LPORT("Received RNID request while in state %s\n", | 432 | FC_LPORT_DBG(lport, "Received RNID request while in state %s\n", |
441 | fc_lport_state(lport)); | 433 | fc_lport_state(lport)); |
442 | 434 | ||
443 | req = fc_frame_payload_get(in_fp, sizeof(*req)); | 435 | req = fc_frame_payload_get(in_fp, sizeof(*req)); |
444 | if (!req) { | 436 | if (!req) { |
@@ -498,8 +490,8 @@ static void fc_lport_recv_adisc_req(struct fc_seq *sp, struct fc_frame *in_fp, | |||
498 | size_t len; | 490 | size_t len; |
499 | u32 f_ctl; | 491 | u32 f_ctl; |
500 | 492 | ||
501 | FC_DEBUG_LPORT("Received ADISC request while in state %s\n", | 493 | FC_LPORT_DBG(lport, "Received ADISC request while in state %s\n", |
502 | fc_lport_state(lport)); | 494 | fc_lport_state(lport)); |
503 | 495 | ||
504 | req = fc_frame_payload_get(in_fp, sizeof(*req)); | 496 | req = fc_frame_payload_get(in_fp, sizeof(*req)); |
505 | if (!req) { | 497 | if (!req) { |
@@ -574,8 +566,8 @@ EXPORT_SYMBOL(fc_fabric_login); | |||
574 | */ | 566 | */ |
575 | void fc_linkup(struct fc_lport *lport) | 567 | void fc_linkup(struct fc_lport *lport) |
576 | { | 568 | { |
577 | FC_DEBUG_LPORT("Link is up for port (%6x)\n", | 569 | printk(KERN_INFO "libfc: Link up on port (%6x)\n", |
578 | fc_host_port_id(lport->host)); | 570 | fc_host_port_id(lport->host)); |
579 | 571 | ||
580 | mutex_lock(&lport->lp_mutex); | 572 | mutex_lock(&lport->lp_mutex); |
581 | if (!lport->link_up) { | 573 | if (!lport->link_up) { |
@@ -595,8 +587,8 @@ EXPORT_SYMBOL(fc_linkup); | |||
595 | void fc_linkdown(struct fc_lport *lport) | 587 | void fc_linkdown(struct fc_lport *lport) |
596 | { | 588 | { |
597 | mutex_lock(&lport->lp_mutex); | 589 | mutex_lock(&lport->lp_mutex); |
598 | FC_DEBUG_LPORT("Link is down for port (%6x)\n", | 590 | printk(KERN_INFO "libfc: Link down on port (%6x)\n", |
599 | fc_host_port_id(lport->host)); | 591 | fc_host_port_id(lport->host)); |
600 | 592 | ||
601 | if (lport->link_up) { | 593 | if (lport->link_up) { |
602 | lport->link_up = 0; | 594 | lport->link_up = 0; |
@@ -701,12 +693,11 @@ void fc_lport_disc_callback(struct fc_lport *lport, enum fc_disc_event event) | |||
701 | { | 693 | { |
702 | switch (event) { | 694 | switch (event) { |
703 | case DISC_EV_SUCCESS: | 695 | case DISC_EV_SUCCESS: |
704 | FC_DEBUG_LPORT("Got a SUCCESS event for port (%6x)\n", | 696 | FC_LPORT_DBG(lport, "Discovery succeeded\n"); |
705 | fc_host_port_id(lport->host)); | ||
706 | break; | 697 | break; |
707 | case DISC_EV_FAILED: | 698 | case DISC_EV_FAILED: |
708 | FC_DEBUG_LPORT("Got a FAILED event for port (%6x)\n", | 699 | printk(KERN_ERR "libfc: Discovery failed for port (%6x)\n", |
709 | fc_host_port_id(lport->host)); | 700 | fc_host_port_id(lport->host)); |
710 | mutex_lock(&lport->lp_mutex); | 701 | mutex_lock(&lport->lp_mutex); |
711 | fc_lport_enter_reset(lport); | 702 | fc_lport_enter_reset(lport); |
712 | mutex_unlock(&lport->lp_mutex); | 703 | mutex_unlock(&lport->lp_mutex); |
@@ -726,8 +717,8 @@ void fc_lport_disc_callback(struct fc_lport *lport, enum fc_disc_event event) | |||
726 | */ | 717 | */ |
727 | static void fc_lport_enter_ready(struct fc_lport *lport) | 718 | static void fc_lport_enter_ready(struct fc_lport *lport) |
728 | { | 719 | { |
729 | FC_DEBUG_LPORT("Port (%6x) entered Ready from state %s\n", | 720 | FC_LPORT_DBG(lport, "Entered READY from state %s\n", |
730 | fc_host_port_id(lport->host), fc_lport_state(lport)); | 721 | fc_lport_state(lport)); |
731 | 722 | ||
732 | fc_lport_state_enter(lport, LPORT_ST_READY); | 723 | fc_lport_state_enter(lport, LPORT_ST_READY); |
733 | 724 | ||
@@ -762,8 +753,8 @@ static void fc_lport_recv_flogi_req(struct fc_seq *sp_in, | |||
762 | u32 local_fid; | 753 | u32 local_fid; |
763 | u32 f_ctl; | 754 | u32 f_ctl; |
764 | 755 | ||
765 | FC_DEBUG_LPORT("Received FLOGI request while in state %s\n", | 756 | FC_LPORT_DBG(lport, "Received FLOGI request while in state %s\n", |
766 | fc_lport_state(lport)); | 757 | fc_lport_state(lport)); |
767 | 758 | ||
768 | fh = fc_frame_header_get(rx_fp); | 759 | fh = fc_frame_header_get(rx_fp); |
769 | remote_fid = ntoh24(fh->fh_s_id); | 760 | remote_fid = ntoh24(fh->fh_s_id); |
@@ -772,12 +763,11 @@ static void fc_lport_recv_flogi_req(struct fc_seq *sp_in, | |||
772 | goto out; | 763 | goto out; |
773 | remote_wwpn = get_unaligned_be64(&flp->fl_wwpn); | 764 | remote_wwpn = get_unaligned_be64(&flp->fl_wwpn); |
774 | if (remote_wwpn == lport->wwpn) { | 765 | if (remote_wwpn == lport->wwpn) { |
775 | FC_DBG("FLOGI from port with same WWPN %llx " | 766 | printk(KERN_WARNING "libfc: Received FLOGI from port " |
776 | "possible configuration error\n", | 767 | "with same WWPN %llx\n", remote_wwpn); |
777 | (unsigned long long)remote_wwpn); | ||
778 | goto out; | 768 | goto out; |
779 | } | 769 | } |
780 | FC_DBG("FLOGI from port WWPN %llx\n", (unsigned long long)remote_wwpn); | 770 | FC_LPORT_DBG(lport, "FLOGI from port WWPN %llx\n", remote_wwpn); |
781 | 771 | ||
782 | /* | 772 | /* |
783 | * XXX what is the right thing to do for FIDs? | 773 | * XXX what is the right thing to do for FIDs? |
@@ -909,7 +899,8 @@ static void fc_lport_recv_req(struct fc_lport *lport, struct fc_seq *sp, | |||
909 | } | 899 | } |
910 | } | 900 | } |
911 | } else { | 901 | } else { |
912 | FC_DBG("dropping invalid frame (eof %x)\n", fr_eof(fp)); | 902 | FC_LPORT_DBG(lport, "dropping invalid frame (eof %x)\n", |
903 | fr_eof(fp)); | ||
913 | fc_frame_free(fp); | 904 | fc_frame_free(fp); |
914 | } | 905 | } |
915 | mutex_unlock(&lport->lp_mutex); | 906 | mutex_unlock(&lport->lp_mutex); |
@@ -947,8 +938,8 @@ EXPORT_SYMBOL(fc_lport_reset); | |||
947 | */ | 938 | */ |
948 | static void fc_lport_enter_reset(struct fc_lport *lport) | 939 | static void fc_lport_enter_reset(struct fc_lport *lport) |
949 | { | 940 | { |
950 | FC_DEBUG_LPORT("Port (%6x) entered RESET state from %s state\n", | 941 | FC_LPORT_DBG(lport, "Entered RESET state from %s state\n", |
951 | fc_host_port_id(lport->host), fc_lport_state(lport)); | 942 | fc_lport_state(lport)); |
952 | 943 | ||
953 | fc_lport_state_enter(lport, LPORT_ST_RESET); | 944 | fc_lport_state_enter(lport, LPORT_ST_RESET); |
954 | 945 | ||
@@ -982,9 +973,9 @@ static void fc_lport_enter_reset(struct fc_lport *lport) | |||
982 | static void fc_lport_error(struct fc_lport *lport, struct fc_frame *fp) | 973 | static void fc_lport_error(struct fc_lport *lport, struct fc_frame *fp) |
983 | { | 974 | { |
984 | unsigned long delay = 0; | 975 | unsigned long delay = 0; |
985 | FC_DEBUG_LPORT("Error %ld in state %s, retries %d\n", | 976 | FC_LPORT_DBG(lport, "Error %ld in state %s, retries %d\n", |
986 | PTR_ERR(fp), fc_lport_state(lport), | 977 | PTR_ERR(fp), fc_lport_state(lport), |
987 | lport->retry_count); | 978 | lport->retry_count); |
988 | 979 | ||
989 | if (!fp || PTR_ERR(fp) == -FC_EX_TIMEOUT) { | 980 | if (!fp || PTR_ERR(fp) == -FC_EX_TIMEOUT) { |
990 | /* | 981 | /* |
@@ -1040,11 +1031,11 @@ static void fc_lport_rft_id_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
1040 | 1031 | ||
1041 | mutex_lock(&lport->lp_mutex); | 1032 | mutex_lock(&lport->lp_mutex); |
1042 | 1033 | ||
1043 | FC_DEBUG_LPORT("Received a RFT_ID response\n"); | 1034 | FC_LPORT_DBG(lport, "Received a RFT_ID response\n"); |
1044 | 1035 | ||
1045 | if (lport->state != LPORT_ST_RFT_ID) { | 1036 | if (lport->state != LPORT_ST_RFT_ID) { |
1046 | FC_DBG("Received a RFT_ID response, but in state %s\n", | 1037 | FC_LPORT_DBG(lport, "Received a RFT_ID response, but in state " |
1047 | fc_lport_state(lport)); | 1038 | "%s\n", fc_lport_state(lport)); |
1048 | if (IS_ERR(fp)) | 1039 | if (IS_ERR(fp)) |
1049 | goto err; | 1040 | goto err; |
1050 | goto out; | 1041 | goto out; |
@@ -1094,11 +1085,11 @@ static void fc_lport_rpn_id_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
1094 | 1085 | ||
1095 | mutex_lock(&lport->lp_mutex); | 1086 | mutex_lock(&lport->lp_mutex); |
1096 | 1087 | ||
1097 | FC_DEBUG_LPORT("Received a RPN_ID response\n"); | 1088 | FC_LPORT_DBG(lport, "Received a RPN_ID response\n"); |
1098 | 1089 | ||
1099 | if (lport->state != LPORT_ST_RPN_ID) { | 1090 | if (lport->state != LPORT_ST_RPN_ID) { |
1100 | FC_DBG("Received a RPN_ID response, but in state %s\n", | 1091 | FC_LPORT_DBG(lport, "Received a RPN_ID response, but in state " |
1101 | fc_lport_state(lport)); | 1092 | "%s\n", fc_lport_state(lport)); |
1102 | if (IS_ERR(fp)) | 1093 | if (IS_ERR(fp)) |
1103 | goto err; | 1094 | goto err; |
1104 | goto out; | 1095 | goto out; |
@@ -1146,11 +1137,11 @@ static void fc_lport_scr_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
1146 | 1137 | ||
1147 | mutex_lock(&lport->lp_mutex); | 1138 | mutex_lock(&lport->lp_mutex); |
1148 | 1139 | ||
1149 | FC_DEBUG_LPORT("Received a SCR response\n"); | 1140 | FC_LPORT_DBG(lport, "Received a SCR response\n"); |
1150 | 1141 | ||
1151 | if (lport->state != LPORT_ST_SCR) { | 1142 | if (lport->state != LPORT_ST_SCR) { |
1152 | FC_DBG("Received a SCR response, but in state %s\n", | 1143 | FC_LPORT_DBG(lport, "Received a SCR response, but in state " |
1153 | fc_lport_state(lport)); | 1144 | "%s\n", fc_lport_state(lport)); |
1154 | if (IS_ERR(fp)) | 1145 | if (IS_ERR(fp)) |
1155 | goto err; | 1146 | goto err; |
1156 | goto out; | 1147 | goto out; |
@@ -1184,8 +1175,8 @@ static void fc_lport_enter_scr(struct fc_lport *lport) | |||
1184 | { | 1175 | { |
1185 | struct fc_frame *fp; | 1176 | struct fc_frame *fp; |
1186 | 1177 | ||
1187 | FC_DEBUG_LPORT("Port (%6x) entered SCR state from %s state\n", | 1178 | FC_LPORT_DBG(lport, "Entered SCR state from %s state\n", |
1188 | fc_host_port_id(lport->host), fc_lport_state(lport)); | 1179 | fc_lport_state(lport)); |
1189 | 1180 | ||
1190 | fc_lport_state_enter(lport, LPORT_ST_SCR); | 1181 | fc_lport_state_enter(lport, LPORT_ST_SCR); |
1191 | 1182 | ||
@@ -1213,8 +1204,8 @@ static void fc_lport_enter_rft_id(struct fc_lport *lport) | |||
1213 | struct fc_ns_fts *lps; | 1204 | struct fc_ns_fts *lps; |
1214 | int i; | 1205 | int i; |
1215 | 1206 | ||
1216 | FC_DEBUG_LPORT("Port (%6x) entered RFT_ID state from %s state\n", | 1207 | FC_LPORT_DBG(lport, "Entered RFT_ID state from %s state\n", |
1217 | fc_host_port_id(lport->host), fc_lport_state(lport)); | 1208 | fc_lport_state(lport)); |
1218 | 1209 | ||
1219 | fc_lport_state_enter(lport, LPORT_ST_RFT_ID); | 1210 | fc_lport_state_enter(lport, LPORT_ST_RFT_ID); |
1220 | 1211 | ||
@@ -1253,8 +1244,8 @@ static void fc_lport_enter_rpn_id(struct fc_lport *lport) | |||
1253 | { | 1244 | { |
1254 | struct fc_frame *fp; | 1245 | struct fc_frame *fp; |
1255 | 1246 | ||
1256 | FC_DEBUG_LPORT("Port (%6x) entered RPN_ID state from %s state\n", | 1247 | FC_LPORT_DBG(lport, "Entered RPN_ID state from %s state\n", |
1257 | fc_host_port_id(lport->host), fc_lport_state(lport)); | 1248 | fc_lport_state(lport)); |
1258 | 1249 | ||
1259 | fc_lport_state_enter(lport, LPORT_ST_RPN_ID); | 1250 | fc_lport_state_enter(lport, LPORT_ST_RPN_ID); |
1260 | 1251 | ||
@@ -1294,8 +1285,8 @@ static void fc_lport_enter_dns(struct fc_lport *lport) | |||
1294 | dp.ids.roles = FC_RPORT_ROLE_UNKNOWN; | 1285 | dp.ids.roles = FC_RPORT_ROLE_UNKNOWN; |
1295 | dp.lp = lport; | 1286 | dp.lp = lport; |
1296 | 1287 | ||
1297 | FC_DEBUG_LPORT("Port (%6x) entered DNS state from %s state\n", | 1288 | FC_LPORT_DBG(lport, "Entered DNS state from %s state\n", |
1298 | fc_host_port_id(lport->host), fc_lport_state(lport)); | 1289 | fc_lport_state(lport)); |
1299 | 1290 | ||
1300 | fc_lport_state_enter(lport, LPORT_ST_DNS); | 1291 | fc_lport_state_enter(lport, LPORT_ST_DNS); |
1301 | 1292 | ||
@@ -1374,11 +1365,11 @@ static void fc_lport_logo_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
1374 | 1365 | ||
1375 | mutex_lock(&lport->lp_mutex); | 1366 | mutex_lock(&lport->lp_mutex); |
1376 | 1367 | ||
1377 | FC_DEBUG_LPORT("Received a LOGO response\n"); | 1368 | FC_LPORT_DBG(lport, "Received a LOGO response\n"); |
1378 | 1369 | ||
1379 | if (lport->state != LPORT_ST_LOGO) { | 1370 | if (lport->state != LPORT_ST_LOGO) { |
1380 | FC_DBG("Received a LOGO response, but in state %s\n", | 1371 | FC_LPORT_DBG(lport, "Received a LOGO response, but in state " |
1381 | fc_lport_state(lport)); | 1372 | "%s\n", fc_lport_state(lport)); |
1382 | if (IS_ERR(fp)) | 1373 | if (IS_ERR(fp)) |
1383 | goto err; | 1374 | goto err; |
1384 | goto out; | 1375 | goto out; |
@@ -1413,8 +1404,8 @@ static void fc_lport_enter_logo(struct fc_lport *lport) | |||
1413 | struct fc_frame *fp; | 1404 | struct fc_frame *fp; |
1414 | struct fc_els_logo *logo; | 1405 | struct fc_els_logo *logo; |
1415 | 1406 | ||
1416 | FC_DEBUG_LPORT("Port (%6x) entered LOGO state from %s state\n", | 1407 | FC_LPORT_DBG(lport, "Entered LOGO state from %s state\n", |
1417 | fc_host_port_id(lport->host), fc_lport_state(lport)); | 1408 | fc_lport_state(lport)); |
1418 | 1409 | ||
1419 | fc_lport_state_enter(lport, LPORT_ST_LOGO); | 1410 | fc_lport_state_enter(lport, LPORT_ST_LOGO); |
1420 | 1411 | ||
@@ -1456,11 +1447,11 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
1456 | 1447 | ||
1457 | mutex_lock(&lport->lp_mutex); | 1448 | mutex_lock(&lport->lp_mutex); |
1458 | 1449 | ||
1459 | FC_DEBUG_LPORT("Received a FLOGI response\n"); | 1450 | FC_LPORT_DBG(lport, "Received a FLOGI response\n"); |
1460 | 1451 | ||
1461 | if (lport->state != LPORT_ST_FLOGI) { | 1452 | if (lport->state != LPORT_ST_FLOGI) { |
1462 | FC_DBG("Received a FLOGI response, but in state %s\n", | 1453 | FC_LPORT_DBG(lport, "Received a FLOGI response, but in state " |
1463 | fc_lport_state(lport)); | 1454 | "%s\n", fc_lport_state(lport)); |
1464 | if (IS_ERR(fp)) | 1455 | if (IS_ERR(fp)) |
1465 | goto err; | 1456 | goto err; |
1466 | goto out; | 1457 | goto out; |
@@ -1475,7 +1466,8 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
1475 | did = ntoh24(fh->fh_d_id); | 1466 | did = ntoh24(fh->fh_d_id); |
1476 | if (fc_frame_payload_op(fp) == ELS_LS_ACC && did != 0) { | 1467 | if (fc_frame_payload_op(fp) == ELS_LS_ACC && did != 0) { |
1477 | 1468 | ||
1478 | FC_DEBUG_LPORT("Assigned fid %x\n", did); | 1469 | printk(KERN_INFO "libfc: Assigned FID (%6x) in FLOGI response\n", |
1470 | did); | ||
1479 | fc_host_port_id(lport->host) = did; | 1471 | fc_host_port_id(lport->host) = did; |
1480 | 1472 | ||
1481 | flp = fc_frame_payload_get(fp, sizeof(*flp)); | 1473 | flp = fc_frame_payload_get(fp, sizeof(*flp)); |
@@ -1494,7 +1486,8 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
1494 | if (e_d_tov > lport->e_d_tov) | 1486 | if (e_d_tov > lport->e_d_tov) |
1495 | lport->e_d_tov = e_d_tov; | 1487 | lport->e_d_tov = e_d_tov; |
1496 | lport->r_a_tov = 2 * e_d_tov; | 1488 | lport->r_a_tov = 2 * e_d_tov; |
1497 | FC_DBG("Point-to-Point mode\n"); | 1489 | printk(KERN_INFO "libfc: Port (%6x) entered " |
1490 | "point to point mode\n", did); | ||
1498 | fc_lport_ptp_setup(lport, ntoh24(fh->fh_s_id), | 1491 | fc_lport_ptp_setup(lport, ntoh24(fh->fh_s_id), |
1499 | get_unaligned_be64( | 1492 | get_unaligned_be64( |
1500 | &flp->fl_wwpn), | 1493 | &flp->fl_wwpn), |
@@ -1517,7 +1510,7 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
1517 | } | 1510 | } |
1518 | } | 1511 | } |
1519 | } else { | 1512 | } else { |
1520 | FC_DBG("bad FLOGI response\n"); | 1513 | FC_LPORT_DBG(lport, "Bad FLOGI response\n"); |
1521 | } | 1514 | } |
1522 | 1515 | ||
1523 | out: | 1516 | out: |
@@ -1537,7 +1530,8 @@ void fc_lport_enter_flogi(struct fc_lport *lport) | |||
1537 | { | 1530 | { |
1538 | struct fc_frame *fp; | 1531 | struct fc_frame *fp; |
1539 | 1532 | ||
1540 | FC_DEBUG_LPORT("Processing FLOGI state\n"); | 1533 | FC_LPORT_DBG(lport, "Entered FLOGI state from %s state\n", |
1534 | fc_lport_state(lport)); | ||
1541 | 1535 | ||
1542 | fc_lport_state_enter(lport, LPORT_ST_FLOGI); | 1536 | fc_lport_state_enter(lport, LPORT_ST_FLOGI); |
1543 | 1537 | ||