aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-13 22:25:38 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-13 22:25:38 -0500
commit0d522ee7499e4abe7189b2f1728e838959b8ddde (patch)
tree094f60e8bdb0083b58a43a0decbca59443a66e39 /drivers/scsi/fcoe
parent5eea9be8b2478dbc2f9fb1cd6228a90e8dba804e (diff)
parent323f6226a816f0b01514d25fba5529e0e68636c3 (diff)
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull first round of SCSI updates from James Bottomley: "This patch set is driver updates for qla4xxx, scsi_debug, pm80xx, fcoe/libfc, eas2r, lpfc, be2iscsi and megaraid_sas plus some assorted bug fixes and cleanups" * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (106 commits) [SCSI] scsi_error: Escalate to LUN reset if abort fails [SCSI] Add 'eh_deadline' to limit SCSI EH runtime [SCSI] remove check for 'resetting' [SCSI] dc395: Move 'last_reset' into internal host structure [SCSI] tmscsim: Move 'last_reset' into host structure [SCSI] advansys: Remove 'last_reset' references [SCSI] dpt_i2o: return SCSI_MLQUEUE_HOST_BUSY when in reset [SCSI] dpt_i2o: Remove DPTI_STATE_IOCTL [SCSI] megaraid_sas: Fix synchronization problem between sysPD IO path and AEN path [SCSI] lpfc: Fix typo on NULL assignment [SCSI] scsi_dh_alua: ALUA handler attach should succeed while TPG is transitioning [SCSI] scsi_dh_alua: ALUA check sense should retry device internal reset unit attention [SCSI] esas2r: Cleanup snprinf formatting of firmware version [SCSI] esas2r: Remove superfluous mask of pcie_cap_reg [SCSI] esas2r: Fixes for big-endian platforms [SCSI] esas2r: Directly call kernel functions for atomic bit operations [SCSI] lpfc 8.3.43: Update lpfc version to driver version 8.3.43 [SCSI] lpfc 8.3.43: Fixed not processing task management IOCB response status [SCSI] lpfc 8.3.43: Fixed spinlock hang. [SCSI] lpfc 8.3.43: Fixed invalid Total_Data_Placed value received for els and ct command responses ...
Diffstat (limited to 'drivers/scsi/fcoe')
-rw-r--r--drivers/scsi/fcoe/fcoe.c25
-rw-r--r--drivers/scsi/fcoe/fcoe_ctlr.c148
-rw-r--r--drivers/scsi/fcoe/fcoe_sysfs.c14
3 files changed, 118 insertions, 69 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 07453bbf05e7..f3170008ae71 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -408,6 +408,7 @@ static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev,
408 } 408 }
409 409
410 ctlr = fcoe_ctlr_device_priv(ctlr_dev); 410 ctlr = fcoe_ctlr_device_priv(ctlr_dev);
411 ctlr->cdev = ctlr_dev;
411 fcoe = fcoe_ctlr_priv(ctlr); 412 fcoe = fcoe_ctlr_priv(ctlr);
412 413
413 dev_hold(netdev); 414 dev_hold(netdev);
@@ -1440,22 +1441,28 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev,
1440 ctlr = fcoe_to_ctlr(fcoe); 1441 ctlr = fcoe_to_ctlr(fcoe);
1441 lport = ctlr->lp; 1442 lport = ctlr->lp;
1442 if (unlikely(!lport)) { 1443 if (unlikely(!lport)) {
1443 FCOE_NETDEV_DBG(netdev, "Cannot find hba structure"); 1444 FCOE_NETDEV_DBG(netdev, "Cannot find hba structure\n");
1444 goto err2; 1445 goto err2;
1445 } 1446 }
1446 if (!lport->link_up) 1447 if (!lport->link_up)
1447 goto err2; 1448 goto err2;
1448 1449
1449 FCOE_NETDEV_DBG(netdev, "skb_info: len:%d data_len:%d head:%p " 1450 FCOE_NETDEV_DBG(netdev,
1450 "data:%p tail:%p end:%p sum:%d dev:%s", 1451 "skb_info: len:%d data_len:%d head:%p data:%p tail:%p end:%p sum:%d dev:%s\n",
1451 skb->len, skb->data_len, skb->head, skb->data, 1452 skb->len, skb->data_len, skb->head, skb->data,
1452 skb_tail_pointer(skb), skb_end_pointer(skb), 1453 skb_tail_pointer(skb), skb_end_pointer(skb),
1453 skb->csum, skb->dev ? skb->dev->name : "<NULL>"); 1454 skb->csum, skb->dev ? skb->dev->name : "<NULL>");
1454 1455
1456
1457 skb = skb_share_check(skb, GFP_ATOMIC);
1458
1459 if (skb == NULL)
1460 return NET_RX_DROP;
1461
1455 eh = eth_hdr(skb); 1462 eh = eth_hdr(skb);
1456 1463
1457 if (is_fip_mode(ctlr) && 1464 if (is_fip_mode(ctlr) &&
1458 compare_ether_addr(eh->h_source, ctlr->dest_addr)) { 1465 !ether_addr_equal(eh->h_source, ctlr->dest_addr)) {
1459 FCOE_NETDEV_DBG(netdev, "wrong source mac address:%pM\n", 1466 FCOE_NETDEV_DBG(netdev, "wrong source mac address:%pM\n",
1460 eh->h_source); 1467 eh->h_source);
1461 goto err; 1468 goto err;
@@ -1540,13 +1547,13 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev,
1540 wake_up_process(fps->thread); 1547 wake_up_process(fps->thread);
1541 spin_unlock(&fps->fcoe_rx_list.lock); 1548 spin_unlock(&fps->fcoe_rx_list.lock);
1542 1549
1543 return 0; 1550 return NET_RX_SUCCESS;
1544err: 1551err:
1545 per_cpu_ptr(lport->stats, get_cpu())->ErrorFrames++; 1552 per_cpu_ptr(lport->stats, get_cpu())->ErrorFrames++;
1546 put_cpu(); 1553 put_cpu();
1547err2: 1554err2:
1548 kfree_skb(skb); 1555 kfree_skb(skb);
1549 return -1; 1556 return NET_RX_DROP;
1550} 1557}
1551 1558
1552/** 1559/**
@@ -1788,13 +1795,13 @@ static void fcoe_recv_frame(struct sk_buff *skb)
1788 lport = fr->fr_dev; 1795 lport = fr->fr_dev;
1789 if (unlikely(!lport)) { 1796 if (unlikely(!lport)) {
1790 if (skb->destructor != fcoe_percpu_flush_done) 1797 if (skb->destructor != fcoe_percpu_flush_done)
1791 FCOE_NETDEV_DBG(skb->dev, "NULL lport in skb"); 1798 FCOE_NETDEV_DBG(skb->dev, "NULL lport in skb\n");
1792 kfree_skb(skb); 1799 kfree_skb(skb);
1793 return; 1800 return;
1794 } 1801 }
1795 1802
1796 FCOE_NETDEV_DBG(skb->dev, "skb_info: len:%d data_len:%d " 1803 FCOE_NETDEV_DBG(skb->dev,
1797 "head:%p data:%p tail:%p end:%p sum:%d dev:%s", 1804 "skb_info: len:%d data_len:%d head:%p data:%p tail:%p end:%p sum:%d dev:%s\n",
1798 skb->len, skb->data_len, 1805 skb->len, skb->data_len,
1799 skb->head, skb->data, skb_tail_pointer(skb), 1806 skb->head, skb->data, skb_tail_pointer(skb),
1800 skb_end_pointer(skb), skb->csum, 1807 skb_end_pointer(skb), skb->csum,
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 203415e02518..34a1b1f333b4 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -160,74 +160,113 @@ void fcoe_ctlr_init(struct fcoe_ctlr *fip, enum fip_state mode)
160} 160}
161EXPORT_SYMBOL(fcoe_ctlr_init); 161EXPORT_SYMBOL(fcoe_ctlr_init);
162 162
163/**
164 * fcoe_sysfs_fcf_add() - Add a fcoe_fcf{,_device} to a fcoe_ctlr{,_device}
165 * @new: The newly discovered FCF
166 *
167 * Called with fip->ctlr_mutex held
168 */
163static int fcoe_sysfs_fcf_add(struct fcoe_fcf *new) 169static int fcoe_sysfs_fcf_add(struct fcoe_fcf *new)
164{ 170{
165 struct fcoe_ctlr *fip = new->fip; 171 struct fcoe_ctlr *fip = new->fip;
166 struct fcoe_ctlr_device *ctlr_dev = fcoe_ctlr_to_ctlr_dev(fip); 172 struct fcoe_ctlr_device *ctlr_dev;
167 struct fcoe_fcf_device temp, *fcf_dev; 173 struct fcoe_fcf_device *temp, *fcf_dev;
168 int rc = 0; 174 int rc = -ENOMEM;
169 175
170 LIBFCOE_FIP_DBG(fip, "New FCF fab %16.16llx mac %pM\n", 176 LIBFCOE_FIP_DBG(fip, "New FCF fab %16.16llx mac %pM\n",
171 new->fabric_name, new->fcf_mac); 177 new->fabric_name, new->fcf_mac);
172 178
173 mutex_lock(&ctlr_dev->lock); 179 temp = kzalloc(sizeof(*temp), GFP_KERNEL);
174 180 if (!temp)
175 temp.fabric_name = new->fabric_name;
176 temp.switch_name = new->switch_name;
177 temp.fc_map = new->fc_map;
178 temp.vfid = new->vfid;
179 memcpy(temp.mac, new->fcf_mac, ETH_ALEN);
180 temp.priority = new->pri;
181 temp.fka_period = new->fka_period;
182 temp.selected = 0; /* default to unselected */
183
184 fcf_dev = fcoe_fcf_device_add(ctlr_dev, &temp);
185 if (unlikely(!fcf_dev)) {
186 rc = -ENOMEM;
187 goto out; 181 goto out;
188 } 182
183 temp->fabric_name = new->fabric_name;
184 temp->switch_name = new->switch_name;
185 temp->fc_map = new->fc_map;
186 temp->vfid = new->vfid;
187 memcpy(temp->mac, new->fcf_mac, ETH_ALEN);
188 temp->priority = new->pri;
189 temp->fka_period = new->fka_period;
190 temp->selected = 0; /* default to unselected */
189 191
190 /* 192 /*
191 * The fcoe_sysfs layer can return a CONNECTED fcf that 193 * If ctlr_dev doesn't exist then it means we're a libfcoe user
192 * has a priv (fcf was never deleted) or a CONNECTED fcf 194 * who doesn't use fcoe_syfs and didn't allocate a fcoe_ctlr_device.
193 * that doesn't have a priv (fcf was deleted). However, 195 * fnic would be an example of a driver with this behavior. In this
194 * libfcoe will always delete FCFs before trying to add 196 * case we want to add the fcoe_fcf to the fcoe_ctlr list, but we
195 * them. This is ensured because both recv_adv and 197 * don't want to make sysfs changes.
196 * age_fcfs are protected by the the fcoe_ctlr's mutex.
197 * This means that we should never get a FCF with a
198 * non-NULL priv pointer.
199 */ 198 */
200 BUG_ON(fcf_dev->priv);
201 199
202 fcf_dev->priv = new; 200 ctlr_dev = fcoe_ctlr_to_ctlr_dev(fip);
203 new->fcf_dev = fcf_dev; 201 if (ctlr_dev) {
202 mutex_lock(&ctlr_dev->lock);
203 fcf_dev = fcoe_fcf_device_add(ctlr_dev, temp);
204 if (unlikely(!fcf_dev)) {
205 rc = -ENOMEM;
206 mutex_unlock(&ctlr_dev->lock);
207 goto out;
208 }
209
210 /*
211 * The fcoe_sysfs layer can return a CONNECTED fcf that
212 * has a priv (fcf was never deleted) or a CONNECTED fcf
213 * that doesn't have a priv (fcf was deleted). However,
214 * libfcoe will always delete FCFs before trying to add
215 * them. This is ensured because both recv_adv and
216 * age_fcfs are protected by the the fcoe_ctlr's mutex.
217 * This means that we should never get a FCF with a
218 * non-NULL priv pointer.
219 */
220 BUG_ON(fcf_dev->priv);
221
222 fcf_dev->priv = new;
223 new->fcf_dev = fcf_dev;
224 mutex_unlock(&ctlr_dev->lock);
225 }
204 226
205 list_add(&new->list, &fip->fcfs); 227 list_add(&new->list, &fip->fcfs);
206 fip->fcf_count++; 228 fip->fcf_count++;
229 rc = 0;
207 230
208out: 231out:
209 mutex_unlock(&ctlr_dev->lock); 232 kfree(temp);
210 return rc; 233 return rc;
211} 234}
212 235
236/**
237 * fcoe_sysfs_fcf_del() - Remove a fcoe_fcf{,_device} to a fcoe_ctlr{,_device}
238 * @new: The FCF to be removed
239 *
240 * Called with fip->ctlr_mutex held
241 */
213static void fcoe_sysfs_fcf_del(struct fcoe_fcf *new) 242static void fcoe_sysfs_fcf_del(struct fcoe_fcf *new)
214{ 243{
215 struct fcoe_ctlr *fip = new->fip; 244 struct fcoe_ctlr *fip = new->fip;
216 struct fcoe_ctlr_device *ctlr_dev = fcoe_ctlr_to_ctlr_dev(fip); 245 struct fcoe_ctlr_device *cdev;
217 struct fcoe_fcf_device *fcf_dev; 246 struct fcoe_fcf_device *fcf_dev;
218 247
219 list_del(&new->list); 248 list_del(&new->list);
220 fip->fcf_count--; 249 fip->fcf_count--;
221 250
222 mutex_lock(&ctlr_dev->lock); 251 /*
223 252 * If ctlr_dev doesn't exist then it means we're a libfcoe user
224 fcf_dev = fcoe_fcf_to_fcf_dev(new); 253 * who doesn't use fcoe_syfs and didn't allocate a fcoe_ctlr_device
225 WARN_ON(!fcf_dev); 254 * or a fcoe_fcf_device.
226 new->fcf_dev = NULL; 255 *
227 fcoe_fcf_device_delete(fcf_dev); 256 * fnic would be an example of a driver with this behavior. In this
228 kfree(new); 257 * case we want to remove the fcoe_fcf from the fcoe_ctlr list (above),
229 258 * but we don't want to make sysfs changes.
230 mutex_unlock(&ctlr_dev->lock); 259 */
260 cdev = fcoe_ctlr_to_ctlr_dev(fip);
261 if (cdev) {
262 mutex_lock(&cdev->lock);
263 fcf_dev = fcoe_fcf_to_fcf_dev(new);
264 WARN_ON(!fcf_dev);
265 new->fcf_dev = NULL;
266 fcoe_fcf_device_delete(fcf_dev);
267 kfree(new);
268 mutex_unlock(&cdev->lock);
269 }
231} 270}
232 271
233/** 272/**
@@ -300,7 +339,7 @@ static void fcoe_ctlr_announce(struct fcoe_ctlr *fip)
300 spin_unlock_bh(&fip->ctlr_lock); 339 spin_unlock_bh(&fip->ctlr_lock);
301 sel = fip->sel_fcf; 340 sel = fip->sel_fcf;
302 341
303 if (sel && !compare_ether_addr(sel->fcf_mac, fip->dest_addr)) 342 if (sel && ether_addr_equal(sel->fcf_mac, fip->dest_addr))
304 goto unlock; 343 goto unlock;
305 if (!is_zero_ether_addr(fip->dest_addr)) { 344 if (!is_zero_ether_addr(fip->dest_addr)) {
306 printk(KERN_NOTICE "libfcoe: host%d: " 345 printk(KERN_NOTICE "libfcoe: host%d: "
@@ -1000,7 +1039,7 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb)
1000 if (fcf->switch_name == new.switch_name && 1039 if (fcf->switch_name == new.switch_name &&
1001 fcf->fabric_name == new.fabric_name && 1040 fcf->fabric_name == new.fabric_name &&
1002 fcf->fc_map == new.fc_map && 1041 fcf->fc_map == new.fc_map &&
1003 compare_ether_addr(fcf->fcf_mac, new.fcf_mac) == 0) { 1042 ether_addr_equal(fcf->fcf_mac, new.fcf_mac)) {
1004 found = 1; 1043 found = 1;
1005 break; 1044 break;
1006 } 1045 }
@@ -1340,7 +1379,7 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
1340 mp = (struct fip_mac_desc *)desc; 1379 mp = (struct fip_mac_desc *)desc;
1341 if (dlen < sizeof(*mp)) 1380 if (dlen < sizeof(*mp))
1342 goto err; 1381 goto err;
1343 if (compare_ether_addr(mp->fd_mac, fcf->fcf_mac)) 1382 if (!ether_addr_equal(mp->fd_mac, fcf->fcf_mac))
1344 goto err; 1383 goto err;
1345 desc_mask &= ~BIT(FIP_DT_MAC); 1384 desc_mask &= ~BIT(FIP_DT_MAC);
1346 break; 1385 break;
@@ -1418,8 +1457,8 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
1418 * 'port_id' is already validated, check MAC address and 1457 * 'port_id' is already validated, check MAC address and
1419 * wwpn 1458 * wwpn
1420 */ 1459 */
1421 if (compare_ether_addr(fip->get_src_addr(vn_port), 1460 if (!ether_addr_equal(fip->get_src_addr(vn_port),
1422 vp->fd_mac) != 0 || 1461 vp->fd_mac) ||
1423 get_unaligned_be64(&vp->fd_wwpn) != 1462 get_unaligned_be64(&vp->fd_wwpn) !=
1424 vn_port->wwpn) 1463 vn_port->wwpn)
1425 continue; 1464 continue;
@@ -1453,6 +1492,9 @@ err:
1453 */ 1492 */
1454void fcoe_ctlr_recv(struct fcoe_ctlr *fip, struct sk_buff *skb) 1493void fcoe_ctlr_recv(struct fcoe_ctlr *fip, struct sk_buff *skb)
1455{ 1494{
1495 skb = skb_share_check(skb, GFP_ATOMIC);
1496 if (!skb)
1497 return;
1456 skb_queue_tail(&fip->fip_recv_list, skb); 1498 skb_queue_tail(&fip->fip_recv_list, skb);
1457 schedule_work(&fip->recv_work); 1499 schedule_work(&fip->recv_work);
1458} 1500}
@@ -1479,12 +1521,12 @@ static int fcoe_ctlr_recv_handler(struct fcoe_ctlr *fip, struct sk_buff *skb)
1479 goto drop; 1521 goto drop;
1480 eh = eth_hdr(skb); 1522 eh = eth_hdr(skb);
1481 if (fip->mode == FIP_MODE_VN2VN) { 1523 if (fip->mode == FIP_MODE_VN2VN) {
1482 if (compare_ether_addr(eh->h_dest, fip->ctl_src_addr) && 1524 if (!ether_addr_equal(eh->h_dest, fip->ctl_src_addr) &&
1483 compare_ether_addr(eh->h_dest, fcoe_all_vn2vn) && 1525 !ether_addr_equal(eh->h_dest, fcoe_all_vn2vn) &&
1484 compare_ether_addr(eh->h_dest, fcoe_all_p2p)) 1526 !ether_addr_equal(eh->h_dest, fcoe_all_p2p))
1485 goto drop; 1527 goto drop;
1486 } else if (compare_ether_addr(eh->h_dest, fip->ctl_src_addr) && 1528 } else if (!ether_addr_equal(eh->h_dest, fip->ctl_src_addr) &&
1487 compare_ether_addr(eh->h_dest, fcoe_all_enode)) 1529 !ether_addr_equal(eh->h_dest, fcoe_all_enode))
1488 goto drop; 1530 goto drop;
1489 fiph = (struct fip_header *)skb->data; 1531 fiph = (struct fip_header *)skb->data;
1490 op = ntohs(fiph->fip_op); 1532 op = ntohs(fiph->fip_op);
@@ -1856,7 +1898,7 @@ int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *fip, struct fc_lport *lport,
1856 * address_mode flag to use FC_OUI-based Ethernet DA. 1898 * address_mode flag to use FC_OUI-based Ethernet DA.
1857 * Otherwise we use the FCoE gateway addr 1899 * Otherwise we use the FCoE gateway addr
1858 */ 1900 */
1859 if (!compare_ether_addr(sa, (u8[6])FC_FCOE_FLOGI_MAC)) { 1901 if (ether_addr_equal(sa, (u8[6])FC_FCOE_FLOGI_MAC)) {
1860 fcoe_ctlr_map_dest(fip); 1902 fcoe_ctlr_map_dest(fip);
1861 } else { 1903 } else {
1862 memcpy(fip->dest_addr, sa, ETH_ALEN); 1904 memcpy(fip->dest_addr, sa, ETH_ALEN);
@@ -2825,8 +2867,8 @@ unlock:
2825 * disabled, so that should ensure that this routine is only called 2867 * disabled, so that should ensure that this routine is only called
2826 * when nothing is happening. 2868 * when nothing is happening.
2827 */ 2869 */
2828void fcoe_ctlr_mode_set(struct fc_lport *lport, struct fcoe_ctlr *fip, 2870static void fcoe_ctlr_mode_set(struct fc_lport *lport, struct fcoe_ctlr *fip,
2829 enum fip_state fip_mode) 2871 enum fip_state fip_mode)
2830{ 2872{
2831 void *priv; 2873 void *priv;
2832 2874
diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
index 1f4f22fe8281..045c4e11ee54 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -300,29 +300,29 @@ static ssize_t store_ctlr_mode(struct device *dev,
300 300
301 switch (ctlr->enabled) { 301 switch (ctlr->enabled) {
302 case FCOE_CTLR_ENABLED: 302 case FCOE_CTLR_ENABLED:
303 LIBFCOE_SYSFS_DBG(ctlr, "Cannot change mode when enabled."); 303 LIBFCOE_SYSFS_DBG(ctlr, "Cannot change mode when enabled.\n");
304 return -EBUSY; 304 return -EBUSY;
305 case FCOE_CTLR_DISABLED: 305 case FCOE_CTLR_DISABLED:
306 if (!ctlr->f->set_fcoe_ctlr_mode) { 306 if (!ctlr->f->set_fcoe_ctlr_mode) {
307 LIBFCOE_SYSFS_DBG(ctlr, 307 LIBFCOE_SYSFS_DBG(ctlr,
308 "Mode change not supported by LLD."); 308 "Mode change not supported by LLD.\n");
309 return -ENOTSUPP; 309 return -ENOTSUPP;
310 } 310 }
311 311
312 ctlr->mode = fcoe_parse_mode(mode); 312 ctlr->mode = fcoe_parse_mode(mode);
313 if (ctlr->mode == FIP_CONN_TYPE_UNKNOWN) { 313 if (ctlr->mode == FIP_CONN_TYPE_UNKNOWN) {
314 LIBFCOE_SYSFS_DBG(ctlr, 314 LIBFCOE_SYSFS_DBG(ctlr, "Unknown mode %s provided.\n",
315 "Unknown mode %s provided.", buf); 315 buf);
316 return -EINVAL; 316 return -EINVAL;
317 } 317 }
318 318
319 ctlr->f->set_fcoe_ctlr_mode(ctlr); 319 ctlr->f->set_fcoe_ctlr_mode(ctlr);
320 LIBFCOE_SYSFS_DBG(ctlr, "Mode changed to %s.", buf); 320 LIBFCOE_SYSFS_DBG(ctlr, "Mode changed to %s.\n", buf);
321 321
322 return count; 322 return count;
323 case FCOE_CTLR_UNUSED: 323 case FCOE_CTLR_UNUSED:
324 default: 324 default:
325 LIBFCOE_SYSFS_DBG(ctlr, "Mode change not supported."); 325 LIBFCOE_SYSFS_DBG(ctlr, "Mode change not supported.\n");
326 return -ENOTSUPP; 326 return -ENOTSUPP;
327 }; 327 };
328} 328}
@@ -657,7 +657,7 @@ static int fcoe_fcf_device_match(struct fcoe_fcf_device *new,
657 if (new->switch_name == old->switch_name && 657 if (new->switch_name == old->switch_name &&
658 new->fabric_name == old->fabric_name && 658 new->fabric_name == old->fabric_name &&
659 new->fc_map == old->fc_map && 659 new->fc_map == old->fc_map &&
660 compare_ether_addr(new->mac, old->mac) == 0) 660 ether_addr_equal(new->mac, old->mac))
661 return 1; 661 return 1;
662 return 0; 662 return 0;
663} 663}