hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/scsi/fcoe/fcoe_ctlr.c
....@@ -1,19 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
34 * Copyright (c) 2009 Intel Corporation. All rights reserved.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along with
15
- * this program; if not, write to the Free Software Foundation, Inc.,
16
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
175 *
186 * Maintained at www.Open-FCoE.org
197 */
....@@ -146,6 +134,7 @@
146134 /**
147135 * fcoe_ctlr_init() - Initialize the FCoE Controller instance
148136 * @fip: The FCoE controller to initialize
137
+ * @mode: FIP mode to set
149138 */
150139 void fcoe_ctlr_init(struct fcoe_ctlr *fip, enum fip_mode mode)
151140 {
....@@ -330,16 +319,17 @@
330319 {
331320 struct fcoe_fcf *sel;
332321 struct fcoe_fcf *fcf;
322
+ unsigned long flags;
333323
334324 mutex_lock(&fip->ctlr_mutex);
335
- spin_lock_bh(&fip->ctlr_lock);
325
+ spin_lock_irqsave(&fip->ctlr_lock, flags);
336326
337327 kfree_skb(fip->flogi_req);
338328 fip->flogi_req = NULL;
339329 list_for_each_entry(fcf, &fip->fcfs, list)
340330 fcf->flogi_sent = 0;
341331
342
- spin_unlock_bh(&fip->ctlr_lock);
332
+ spin_unlock_irqrestore(&fip->ctlr_lock, flags);
343333 sel = fip->sel_fcf;
344334
345335 if (sel && ether_addr_equal(sel->fcf_mac, fip->dest_addr))
....@@ -348,7 +338,7 @@
348338 printk(KERN_NOTICE "libfcoe: host%d: "
349339 "FIP Fibre-Channel Forwarder MAC %pM deselected\n",
350340 fip->lp->host->host_no, fip->dest_addr);
351
- memset(fip->dest_addr, 0, ETH_ALEN);
341
+ eth_zero_addr(fip->dest_addr);
352342 }
353343 if (sel) {
354344 printk(KERN_INFO "libfcoe: host%d: FIP selected "
....@@ -461,10 +451,10 @@
461451 switch (fip->mode) {
462452 default:
463453 LIBFCOE_FIP_DBG(fip, "invalid mode %d\n", fip->mode);
464
- /* fall-through */
454
+ fallthrough;
465455 case FIP_MODE_AUTO:
466456 LIBFCOE_FIP_DBG(fip, "%s", "setting AUTO mode.\n");
467
- /* fall-through */
457
+ fallthrough;
468458 case FIP_MODE_FABRIC:
469459 case FIP_MODE_NON_FIP:
470460 mutex_unlock(&fip->ctlr_mutex);
....@@ -599,6 +589,7 @@
599589 /**
600590 * fcoe_ctlr_encaps() - Encapsulate an ELS frame for FIP, without sending it
601591 * @fip: The FCoE controller for the ELS frame
592
+ * @lport: The local port
602593 * @dtype: The FIP descriptor type for the frame
603594 * @skb: The FCoE ELS frame including FC header but no FCoE headers
604595 * @d_id: The destination port ID.
....@@ -709,6 +700,7 @@
709700 {
710701 struct fc_frame *fp;
711702 struct fc_frame_header *fh;
703
+ unsigned long flags;
712704 u16 old_xid;
713705 u8 op;
714706 u8 mac[ETH_ALEN];
....@@ -742,11 +734,11 @@
742734 op = FIP_DT_FLOGI;
743735 if (fip->mode == FIP_MODE_VN2VN)
744736 break;
745
- spin_lock_bh(&fip->ctlr_lock);
737
+ spin_lock_irqsave(&fip->ctlr_lock, flags);
746738 kfree_skb(fip->flogi_req);
747739 fip->flogi_req = skb;
748740 fip->flogi_req_send = 1;
749
- spin_unlock_bh(&fip->ctlr_lock);
741
+ spin_unlock_irqrestore(&fip->ctlr_lock, flags);
750742 schedule_work(&fip->timer_work);
751743 return -EINPROGRESS;
752744 case ELS_FDISC:
....@@ -783,7 +775,7 @@
783775 fc_fcoe_set_mac(mac, fh->fh_d_id);
784776 fip->update_mac(lport, mac);
785777 }
786
- /* fall through */
778
+ fallthrough;
787779 case ELS_LS_RJT:
788780 op = fr_encaps(fp);
789781 if (op)
....@@ -838,7 +830,7 @@
838830
839831 INIT_LIST_HEAD(&del_list);
840832
841
- stats = per_cpu_ptr(fip->lp->stats, get_cpu_light());
833
+ stats = per_cpu_ptr(fip->lp->stats, get_cpu());
842834
843835 list_for_each_entry_safe(fcf, next, &fip->fcfs, list) {
844836 deadline = fcf->time + fcf->fka_period + fcf->fka_period / 2;
....@@ -874,7 +866,7 @@
874866 sel_time = fcf->time;
875867 }
876868 }
877
- put_cpu_light();
869
+ put_cpu();
878870
879871 list_for_each_entry_safe(fcf, next, &del_list, list) {
880872 /* Removes fcf from current list */
....@@ -1031,7 +1023,7 @@
10311023 {
10321024 struct fcoe_fcf *fcf;
10331025 struct fcoe_fcf new;
1034
- unsigned long sol_tov = msecs_to_jiffies(FCOE_CTRL_SOL_TOV);
1026
+ unsigned long sol_tov = msecs_to_jiffies(FCOE_CTLR_SOL_TOV);
10351027 int first = 0;
10361028 int mtu_valid;
10371029 int found = 0;
....@@ -1314,7 +1306,7 @@
13141306 /**
13151307 * fcoe_ctlr_recv_els() - Handle an incoming link reset frame
13161308 * @fip: The FCoE controller that received the frame
1317
- * @fh: The received FIP header
1309
+ * @skb: The received FIP packet
13181310 *
13191311 * There may be multiple VN_Port descriptors.
13201312 * The overall length has already been checked.
....@@ -1723,10 +1715,11 @@
17231715 static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip)
17241716 {
17251717 struct fcoe_fcf *fcf;
1718
+ unsigned long flags;
17261719 int error;
17271720
17281721 mutex_lock(&fip->ctlr_mutex);
1729
- spin_lock_bh(&fip->ctlr_lock);
1722
+ spin_lock_irqsave(&fip->ctlr_lock, flags);
17301723 LIBFCOE_FIP_DBG(fip, "re-sending FLOGI - reselect\n");
17311724 fcf = fcoe_ctlr_select(fip);
17321725 if (!fcf || fcf->flogi_sent) {
....@@ -1737,7 +1730,7 @@
17371730 fcoe_ctlr_solicit(fip, NULL);
17381731 error = fcoe_ctlr_flogi_send_locked(fip);
17391732 }
1740
- spin_unlock_bh(&fip->ctlr_lock);
1733
+ spin_unlock_irqrestore(&fip->ctlr_lock, flags);
17411734 mutex_unlock(&fip->ctlr_mutex);
17421735 return error;
17431736 }
....@@ -1754,8 +1747,9 @@
17541747 static void fcoe_ctlr_flogi_send(struct fcoe_ctlr *fip)
17551748 {
17561749 struct fcoe_fcf *fcf;
1750
+ unsigned long flags;
17571751
1758
- spin_lock_bh(&fip->ctlr_lock);
1752
+ spin_lock_irqsave(&fip->ctlr_lock, flags);
17591753 fcf = fip->sel_fcf;
17601754 if (!fcf || !fip->flogi_req_send)
17611755 goto unlock;
....@@ -1782,12 +1776,12 @@
17821776 } else /* XXX */
17831777 LIBFCOE_FIP_DBG(fip, "No FCF selected - defer send\n");
17841778 unlock:
1785
- spin_unlock_bh(&fip->ctlr_lock);
1779
+ spin_unlock_irqrestore(&fip->ctlr_lock, flags);
17861780 }
17871781
17881782 /**
17891783 * fcoe_ctlr_timeout() - FIP timeout handler
1790
- * @arg: The FCoE controller that timed out
1784
+ * @t: Timer context use to obtain the controller reference
17911785 */
17921786 static void fcoe_ctlr_timeout(struct timer_list *t)
17931787 {
....@@ -1899,6 +1893,7 @@
18991893 /**
19001894 * fcoe_ctlr_recv_flogi() - Snoop pre-FIP receipt of FLOGI response
19011895 * @fip: The FCoE controller
1896
+ * @lport: The local port
19021897 * @fp: The FC frame to snoop
19031898 *
19041899 * Snoop potential response to FLOGI or even incoming FLOGI.
....@@ -1978,7 +1973,7 @@
19781973 *
19791974 * Returns: u64 fc world wide name
19801975 */
1981
-u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN],
1976
+u64 fcoe_wwn_from_mac(unsigned char mac[ETH_ALEN],
19821977 unsigned int scheme, unsigned int port)
19831978 {
19841979 u64 wwn;
....@@ -2170,7 +2165,7 @@
21702165
21712166 /**
21722167 * fcoe_ctlr_disc_stop_locked() - stop discovery in VN2VN mode
2173
- * @fip: The FCoE controller
2168
+ * @lport: The local port
21742169 *
21752170 * Called with ctlr_mutex held.
21762171 */
....@@ -2191,7 +2186,7 @@
21912186
21922187 /**
21932188 * fcoe_ctlr_disc_stop() - stop discovery in VN2VN mode
2194
- * @fip: The FCoE controller
2189
+ * @lport: The local port
21952190 *
21962191 * Called through the local port template for discovery.
21972192 * Called without the ctlr_mutex held.
....@@ -2207,7 +2202,7 @@
22072202
22082203 /**
22092204 * fcoe_ctlr_disc_stop_final() - stop discovery for shutdown in VN2VN mode
2210
- * @fip: The FCoE controller
2205
+ * @lport: The local port
22112206 *
22122207 * Called through the local port template for discovery.
22132208 * Called without the ctlr_mutex held.
....@@ -2274,7 +2269,7 @@
22742269 * fcoe_ctlr_vn_parse - parse probe request or response
22752270 * @fip: The FCoE controller
22762271 * @skb: incoming packet
2277
- * @rdata: buffer for resulting parsed VN entry plus fcoe_rport
2272
+ * @frport: parsed FCoE rport from the probe request
22782273 *
22792274 * Returns non-zero error number on error.
22802275 * Does not consume the packet.
....@@ -2413,16 +2408,14 @@
24132408 /**
24142409 * fcoe_ctlr_vn_probe_req() - handle incoming VN2VN probe request.
24152410 * @fip: The FCoE controller
2416
- * @rdata: parsed remote port with frport from the probe request
2411
+ * @frport: parsed FCoE rport from the probe request
24172412 *
24182413 * Called with ctlr_mutex held.
24192414 */
24202415 static void fcoe_ctlr_vn_probe_req(struct fcoe_ctlr *fip,
2421
- struct fc_rport_priv *rdata)
2416
+ struct fcoe_rport *frport)
24222417 {
2423
- struct fcoe_rport *frport = fcoe_ctlr_rport(rdata);
2424
-
2425
- if (rdata->ids.port_id != fip->port_id)
2418
+ if (frport->rdata.ids.port_id != fip->port_id)
24262419 return;
24272420
24282421 switch (fip->state) {
....@@ -2442,7 +2435,7 @@
24422435 * Probe's REC bit is not set.
24432436 * If we don't reply, we will change our address.
24442437 */
2445
- if (fip->lp->wwpn > rdata->ids.port_name &&
2438
+ if (fip->lp->wwpn > frport->rdata.ids.port_name &&
24462439 !(frport->flags & FIP_FL_REC_OR_P2P)) {
24472440 LIBFCOE_FIP_DBG(fip, "vn_probe_req: "
24482441 "port_id collision\n");
....@@ -2450,7 +2443,7 @@
24502443 frport->enode_mac, 0);
24512444 break;
24522445 }
2453
- /* fall through */
2446
+ fallthrough;
24542447 case FIP_ST_VNMP_START:
24552448 LIBFCOE_FIP_DBG(fip, "vn_probe_req: "
24562449 "restart VN2VN negotiation\n");
....@@ -2466,14 +2459,14 @@
24662459 /**
24672460 * fcoe_ctlr_vn_probe_reply() - handle incoming VN2VN probe reply.
24682461 * @fip: The FCoE controller
2469
- * @rdata: parsed remote port with frport from the probe request
2462
+ * @frport: parsed FCoE rport from the probe request
24702463 *
24712464 * Called with ctlr_mutex held.
24722465 */
24732466 static void fcoe_ctlr_vn_probe_reply(struct fcoe_ctlr *fip,
2474
- struct fc_rport_priv *rdata)
2467
+ struct fcoe_rport *frport)
24752468 {
2476
- if (rdata->ids.port_id != fip->port_id)
2469
+ if (frport->rdata.ids.port_id != fip->port_id)
24772470 return;
24782471 switch (fip->state) {
24792472 case FIP_ST_VNMP_START:
....@@ -2496,11 +2489,11 @@
24962489 /**
24972490 * fcoe_ctlr_vn_add() - Add a VN2VN entry to the list, based on a claim reply.
24982491 * @fip: The FCoE controller
2499
- * @new: newly-parsed remote port with frport as a template for new rdata
2492
+ * @new: newly-parsed FCoE rport as a template for new rdata
25002493 *
25012494 * Called with ctlr_mutex held.
25022495 */
2503
-static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fc_rport_priv *new)
2496
+static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fcoe_rport *new)
25042497 {
25052498 struct fc_lport *lport = fip->lp;
25062499 struct fc_rport_priv *rdata;
....@@ -2508,7 +2501,7 @@
25082501 struct fcoe_rport *frport;
25092502 u32 port_id;
25102503
2511
- port_id = new->ids.port_id;
2504
+ port_id = new->rdata.ids.port_id;
25122505 if (port_id == fip->port_id)
25132506 return;
25142507
....@@ -2525,22 +2518,28 @@
25252518 rdata->disc_id = lport->disc.disc_id;
25262519
25272520 ids = &rdata->ids;
2528
- if ((ids->port_name != -1 && ids->port_name != new->ids.port_name) ||
2529
- (ids->node_name != -1 && ids->node_name != new->ids.node_name)) {
2521
+ if ((ids->port_name != -1 &&
2522
+ ids->port_name != new->rdata.ids.port_name) ||
2523
+ (ids->node_name != -1 &&
2524
+ ids->node_name != new->rdata.ids.node_name)) {
25302525 mutex_unlock(&rdata->rp_mutex);
25312526 LIBFCOE_FIP_DBG(fip, "vn_add rport logoff %6.6x\n", port_id);
25322527 fc_rport_logoff(rdata);
25332528 mutex_lock(&rdata->rp_mutex);
25342529 }
2535
- ids->port_name = new->ids.port_name;
2536
- ids->node_name = new->ids.node_name;
2530
+ ids->port_name = new->rdata.ids.port_name;
2531
+ ids->node_name = new->rdata.ids.node_name;
25372532 mutex_unlock(&rdata->rp_mutex);
25382533
25392534 frport = fcoe_ctlr_rport(rdata);
25402535 LIBFCOE_FIP_DBG(fip, "vn_add rport %6.6x %s state %d\n",
25412536 port_id, frport->fcoe_len ? "old" : "new",
25422537 rdata->rp_state);
2543
- *frport = *fcoe_ctlr_rport(new);
2538
+ frport->fcoe_len = new->fcoe_len;
2539
+ frport->flags = new->flags;
2540
+ frport->login_count = new->login_count;
2541
+ memcpy(frport->enode_mac, new->enode_mac, ETH_ALEN);
2542
+ memcpy(frport->vn_mac, new->vn_mac, ETH_ALEN);
25442543 frport->time = 0;
25452544 }
25462545
....@@ -2572,16 +2571,14 @@
25722571 /**
25732572 * fcoe_ctlr_vn_claim_notify() - handle received FIP VN2VN Claim Notification
25742573 * @fip: The FCoE controller
2575
- * @new: newly-parsed remote port with frport as a template for new rdata
2574
+ * @new: newly-parsed FCoE rport as a template for new rdata
25762575 *
25772576 * Called with ctlr_mutex held.
25782577 */
25792578 static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip,
2580
- struct fc_rport_priv *new)
2579
+ struct fcoe_rport *new)
25812580 {
2582
- struct fcoe_rport *frport = fcoe_ctlr_rport(new);
2583
-
2584
- if (frport->flags & FIP_FL_REC_OR_P2P) {
2581
+ if (new->flags & FIP_FL_REC_OR_P2P) {
25852582 LIBFCOE_FIP_DBG(fip, "send probe req for P2P/REC\n");
25862583 fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0);
25872584 return;
....@@ -2590,7 +2587,7 @@
25902587 case FIP_ST_VNMP_START:
25912588 case FIP_ST_VNMP_PROBE1:
25922589 case FIP_ST_VNMP_PROBE2:
2593
- if (new->ids.port_id == fip->port_id) {
2590
+ if (new->rdata.ids.port_id == fip->port_id) {
25942591 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "
25952592 "restart, state %d\n",
25962593 fip->state);
....@@ -2599,8 +2596,8 @@
25992596 break;
26002597 case FIP_ST_VNMP_CLAIM:
26012598 case FIP_ST_VNMP_UP:
2602
- if (new->ids.port_id == fip->port_id) {
2603
- if (new->ids.port_name > fip->lp->wwpn) {
2599
+ if (new->rdata.ids.port_id == fip->port_id) {
2600
+ if (new->rdata.ids.port_name > fip->lp->wwpn) {
26042601 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "
26052602 "restart, port_id collision\n");
26062603 fcoe_ctlr_vn_restart(fip);
....@@ -2612,15 +2609,16 @@
26122609 break;
26132610 }
26142611 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: send reply to %x\n",
2615
- new->ids.port_id);
2616
- fcoe_ctlr_vn_send(fip, FIP_SC_VN_CLAIM_REP, frport->enode_mac,
2617
- min((u32)frport->fcoe_len,
2612
+ new->rdata.ids.port_id);
2613
+ fcoe_ctlr_vn_send(fip, FIP_SC_VN_CLAIM_REP, new->enode_mac,
2614
+ min((u32)new->fcoe_len,
26182615 fcoe_ctlr_fcoe_size(fip)));
26192616 fcoe_ctlr_vn_add(fip, new);
26202617 break;
26212618 default:
26222619 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "
2623
- "ignoring claim from %x\n", new->ids.port_id);
2620
+ "ignoring claim from %x\n",
2621
+ new->rdata.ids.port_id);
26242622 break;
26252623 }
26262624 }
....@@ -2628,15 +2626,15 @@
26282626 /**
26292627 * fcoe_ctlr_vn_claim_resp() - handle received Claim Response
26302628 * @fip: The FCoE controller that received the frame
2631
- * @new: newly-parsed remote port with frport from the Claim Response
2629
+ * @new: newly-parsed FCoE rport from the Claim Response
26322630 *
26332631 * Called with ctlr_mutex held.
26342632 */
26352633 static void fcoe_ctlr_vn_claim_resp(struct fcoe_ctlr *fip,
2636
- struct fc_rport_priv *new)
2634
+ struct fcoe_rport *new)
26372635 {
26382636 LIBFCOE_FIP_DBG(fip, "claim resp from from rport %x - state %s\n",
2639
- new->ids.port_id, fcoe_ctlr_state(fip->state));
2637
+ new->rdata.ids.port_id, fcoe_ctlr_state(fip->state));
26402638 if (fip->state == FIP_ST_VNMP_UP || fip->state == FIP_ST_VNMP_CLAIM)
26412639 fcoe_ctlr_vn_add(fip, new);
26422640 }
....@@ -2644,28 +2642,28 @@
26442642 /**
26452643 * fcoe_ctlr_vn_beacon() - handle received beacon.
26462644 * @fip: The FCoE controller that received the frame
2647
- * @new: newly-parsed remote port with frport from the Beacon
2645
+ * @new: newly-parsed FCoE rport from the Beacon
26482646 *
26492647 * Called with ctlr_mutex held.
26502648 */
26512649 static void fcoe_ctlr_vn_beacon(struct fcoe_ctlr *fip,
2652
- struct fc_rport_priv *new)
2650
+ struct fcoe_rport *new)
26532651 {
26542652 struct fc_lport *lport = fip->lp;
26552653 struct fc_rport_priv *rdata;
26562654 struct fcoe_rport *frport;
26572655
2658
- frport = fcoe_ctlr_rport(new);
2659
- if (frport->flags & FIP_FL_REC_OR_P2P) {
2656
+ if (new->flags & FIP_FL_REC_OR_P2P) {
26602657 LIBFCOE_FIP_DBG(fip, "p2p beacon while in vn2vn mode\n");
26612658 fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0);
26622659 return;
26632660 }
2664
- rdata = fc_rport_lookup(lport, new->ids.port_id);
2661
+ rdata = fc_rport_lookup(lport, new->rdata.ids.port_id);
26652662 if (rdata) {
2666
- if (rdata->ids.node_name == new->ids.node_name &&
2667
- rdata->ids.port_name == new->ids.port_name) {
2663
+ if (rdata->ids.node_name == new->rdata.ids.node_name &&
2664
+ rdata->ids.port_name == new->rdata.ids.port_name) {
26682665 frport = fcoe_ctlr_rport(rdata);
2666
+
26692667 LIBFCOE_FIP_DBG(fip, "beacon from rport %x\n",
26702668 rdata->ids.port_id);
26712669 if (!frport->time && fip->state == FIP_ST_VNMP_UP) {
....@@ -2688,7 +2686,7 @@
26882686 * Don't add the neighbor yet.
26892687 */
26902688 LIBFCOE_FIP_DBG(fip, "beacon from new rport %x. sending claim notify\n",
2691
- new->ids.port_id);
2689
+ new->rdata.ids.port_id);
26922690 if (time_after(jiffies,
26932691 fip->sol_time + msecs_to_jiffies(FIP_VN_ANN_WAIT)))
26942692 fcoe_ctlr_vn_send_claim(fip);
....@@ -2773,19 +2771,19 @@
27732771 mutex_lock(&fip->ctlr_mutex);
27742772 switch (sub) {
27752773 case FIP_SC_VN_PROBE_REQ:
2776
- fcoe_ctlr_vn_probe_req(fip, &frport.rdata);
2774
+ fcoe_ctlr_vn_probe_req(fip, &frport);
27772775 break;
27782776 case FIP_SC_VN_PROBE_REP:
2779
- fcoe_ctlr_vn_probe_reply(fip, &frport.rdata);
2777
+ fcoe_ctlr_vn_probe_reply(fip, &frport);
27802778 break;
27812779 case FIP_SC_VN_CLAIM_NOTIFY:
2782
- fcoe_ctlr_vn_claim_notify(fip, &frport.rdata);
2780
+ fcoe_ctlr_vn_claim_notify(fip, &frport);
27832781 break;
27842782 case FIP_SC_VN_CLAIM_REP:
2785
- fcoe_ctlr_vn_claim_resp(fip, &frport.rdata);
2783
+ fcoe_ctlr_vn_claim_resp(fip, &frport);
27862784 break;
27872785 case FIP_SC_VN_BEACON:
2788
- fcoe_ctlr_vn_beacon(fip, &frport.rdata);
2786
+ fcoe_ctlr_vn_beacon(fip, &frport);
27892787 break;
27902788 default:
27912789 LIBFCOE_FIP_DBG(fip, "vn_recv unknown subcode %d\n", sub);
....@@ -2802,7 +2800,7 @@
28022800 * fcoe_ctlr_vlan_parse - parse vlan discovery request or response
28032801 * @fip: The FCoE controller
28042802 * @skb: incoming packet
2805
- * @rdata: buffer for resulting parsed VLAN entry plus fcoe_rport
2803
+ * @frport: parsed FCoE rport from the probe request
28062804 *
28072805 * Returns non-zero error number on error.
28082806 * Does not consume the packet.
....@@ -2901,7 +2899,6 @@
29012899 * @fip: The FCoE controller
29022900 * @sub: sub-opcode for vlan notification or vn2vn vlan notification
29032901 * @dest: The destination Ethernet MAC address
2904
- * @min_len: minimum size of the Ethernet payload to be sent
29052902 */
29062903 static void fcoe_ctlr_vlan_send(struct fcoe_ctlr *fip,
29072904 enum fip_vlan_subcode sub,
....@@ -2961,13 +2958,13 @@
29612958 /**
29622959 * fcoe_ctlr_vlan_disk_reply() - send FIP VLAN Discovery Notification.
29632960 * @fip: The FCoE controller
2961
+ * @frport: The newly-parsed FCoE rport from the Discovery Request
29642962 *
29652963 * Called with ctlr_mutex held.
29662964 */
29672965 static void fcoe_ctlr_vlan_disc_reply(struct fcoe_ctlr *fip,
2968
- struct fc_rport_priv *rdata)
2966
+ struct fcoe_rport *frport)
29692967 {
2970
- struct fcoe_rport *frport = fcoe_ctlr_rport(rdata);
29712968 enum fip_vlan_subcode sub = FIP_SC_VL_NOTE;
29722969
29732970 if (fip->mode == FIP_MODE_VN2VN)
....@@ -2978,9 +2975,8 @@
29782975
29792976 /**
29802977 * fcoe_ctlr_vlan_recv - vlan request receive handler for VN2VN mode.
2981
- * @lport: The local port
2982
- * @fp: The received frame
2983
- *
2978
+ * @fip: The FCoE controller
2979
+ * @skb: The received FIP packet
29842980 */
29852981 static int fcoe_ctlr_vlan_recv(struct fcoe_ctlr *fip, struct sk_buff *skb)
29862982 {
....@@ -2998,7 +2994,7 @@
29982994 }
29992995 mutex_lock(&fip->ctlr_mutex);
30002996 if (sub == FIP_SC_VL_REQ)
3001
- fcoe_ctlr_vlan_disc_reply(fip, &frport.rdata);
2997
+ fcoe_ctlr_vlan_disc_reply(fip, &frport);
30022998 mutex_unlock(&fip->ctlr_mutex);
30032999
30043000 drop:
....@@ -3024,9 +3020,8 @@
30243020 fc_frame_free(fp);
30253021 }
30263022
3027
-/**
3028
- * fcoe_ctlr_disc_recv - start discovery for VN2VN mode.
3029
- * @fip: The FCoE controller
3023
+/*
3024
+ * fcoe_ctlr_disc_start - start discovery for VN2VN mode.
30303025 *
30313026 * This sets a flag indicating that remote ports should be created
30323027 * and started for the peers we discover. We use the disc_callback