ncsi-manage.c (27fa107d3b8d13a57cdd7c7a40bd6548d4b9cef8) ncsi-manage.c (abd2fddc94a619b96bf41c60429d4c32bd118e17)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright Gavin Shan, IBM Corporation 2016.
4 */
5
6#include <linux/module.h>
7#include <linux/kernel.h>
8#include <linux/init.h>

--- 675 unchanged lines hidden (view full) ---

684 nca->words[1] = vid;
685 /* HW filter index starts at 1 */
686 nca->bytes[6] = index + 1;
687 nca->bytes[7] = 0x01;
688
689 return 0;
690}
691
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright Gavin Shan, IBM Corporation 2016.
4 */
5
6#include <linux/module.h>
7#include <linux/kernel.h>
8#include <linux/init.h>

--- 675 unchanged lines hidden (view full) ---

684 nca->words[1] = vid;
685 /* HW filter index starts at 1 */
686 nca->bytes[6] = index + 1;
687 nca->bytes[7] = 0x01;
688
689 return 0;
690}
691
692#if IS_ENABLED(CONFIG_NCSI_OEM_CMD_KEEP_PHY)
693
694static int ncsi_oem_keep_phy_intel(struct ncsi_cmd_arg *nca)
695{
696 unsigned char data[NCSI_OEM_INTEL_CMD_KEEP_PHY_LEN];
697 int ret = 0;
698
699 nca->payload = NCSI_OEM_INTEL_CMD_KEEP_PHY_LEN;
700
701 memset(data, 0, NCSI_OEM_INTEL_CMD_KEEP_PHY_LEN);
702 *(unsigned int *)data = ntohl((__force __be32)NCSI_OEM_MFR_INTEL_ID);
703
704 data[4] = NCSI_OEM_INTEL_CMD_KEEP_PHY;
705
706 /* PHY Link up attribute */
707 data[6] = 0x1;
708
709 nca->data = data;
710
711 ret = ncsi_xmit_cmd(nca);
712 if (ret)
713 netdev_err(nca->ndp->ndev.dev,
714 "NCSI: Failed to transmit cmd 0x%x during configure\n",
715 nca->type);
716 return ret;
717}
718
719#endif
720
692#if IS_ENABLED(CONFIG_NCSI_OEM_CMD_GET_MAC)
693
694/* NCSI OEM Command APIs */
695static int ncsi_oem_gma_handler_bcm(struct ncsi_cmd_arg *nca)
696{
697 unsigned char data[NCSI_OEM_BCM_CMD_GMA_LEN];
698 int ret = 0;
699

--- 687 unchanged lines hidden (view full) ---

1387 for (index = 0; index < NCSI_RESERVED_CHANNEL; index++) {
1388 nca.channel = index;
1389 ret = ncsi_xmit_cmd(&nca);
1390 if (ret)
1391 goto error;
1392 }
1393
1394 nd->state = ncsi_dev_state_probe_gvi;
721#if IS_ENABLED(CONFIG_NCSI_OEM_CMD_GET_MAC)
722
723/* NCSI OEM Command APIs */
724static int ncsi_oem_gma_handler_bcm(struct ncsi_cmd_arg *nca)
725{
726 unsigned char data[NCSI_OEM_BCM_CMD_GMA_LEN];
727 int ret = 0;
728

--- 687 unchanged lines hidden (view full) ---

1416 for (index = 0; index < NCSI_RESERVED_CHANNEL; index++) {
1417 nca.channel = index;
1418 ret = ncsi_xmit_cmd(&nca);
1419 if (ret)
1420 goto error;
1421 }
1422
1423 nd->state = ncsi_dev_state_probe_gvi;
1424 if (IS_ENABLED(CONFIG_NCSI_OEM_CMD_KEEP_PHY))
1425 nd->state = ncsi_dev_state_probe_keep_phy;
1395 break;
1426 break;
1427#if IS_ENABLED(CONFIG_NCSI_OEM_CMD_KEEP_PHY)
1428 case ncsi_dev_state_probe_keep_phy:
1429 ndp->pending_req_num = 1;
1430
1431 nca.type = NCSI_PKT_CMD_OEM;
1432 nca.package = ndp->active_package->id;
1433 nca.channel = 0;
1434 ret = ncsi_oem_keep_phy_intel(&nca);
1435 if (ret)
1436 goto error;
1437
1438 nd->state = ncsi_dev_state_probe_gvi;
1439 break;
1440#endif /* CONFIG_NCSI_OEM_CMD_KEEP_PHY */
1396 case ncsi_dev_state_probe_gvi:
1397 case ncsi_dev_state_probe_gc:
1398 case ncsi_dev_state_probe_gls:
1399 np = ndp->active_package;
1400 ndp->pending_req_num = np->channel_num;
1401
1402 /* Retrieve version, capability or link status */
1403 if (nd->state == ncsi_dev_state_probe_gvi)

--- 497 unchanged lines hidden ---
1441 case ncsi_dev_state_probe_gvi:
1442 case ncsi_dev_state_probe_gc:
1443 case ncsi_dev_state_probe_gls:
1444 np = ndp->active_package;
1445 ndp->pending_req_num = np->channel_num;
1446
1447 /* Retrieve version, capability or link status */
1448 if (nd->state == ncsi_dev_state_probe_gvi)

--- 497 unchanged lines hidden ---