/linux/drivers/net/ethernet/freescale/dpaa2/ |
H A D | dpaa2-mac.c | 1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 5 #include <linux/pcs-lynx.h> 9 #include "dpaa2-eth.h" 10 #include "dpaa2-mac.h" 20 static int dpaa2_mac_cmp_ver(struct dpaa2_mac *mac, in dpaa2_mac_cmp_ver() argument 23 if (mac->ver_major == ver_major) in dpaa2_mac_cmp_ver() 24 return mac->ver_minor - ver_minor; in dpaa2_mac_cmp_ver() 25 return mac->ver_major - ver_major; in dpaa2_mac_cmp_ver() 28 static void dpaa2_mac_detect_features(struct dpaa2_mac *mac) in dpaa2_mac_detect_features() argument 30 mac->features = 0; in dpaa2_mac_detect_features() [all …]
|
/linux/drivers/net/ethernet/chelsio/cxgb3/ |
H A D | xgmac.c | 2 * Copyright (c) 2005-2008 Chelsio, Inc. All rights reserved. 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 41 static inline int macidx(const struct cmac *mac) in macidx() argument 43 return mac->offset / (XGMAC0_1_BASE_ADDR - XGMAC0_0_BASE_ADDR); in macidx() 46 static void xaui_serdes_reset(struct cmac *mac) in xaui_serdes_reset() argument 54 struct adapter *adap = mac->adapter; in xaui_serdes_reset() 55 u32 ctrl = A_XGM_SERDES_CTRL0 + mac->offset; in xaui_serdes_reset() 57 t3_write_reg(adap, ctrl, adap->params.vpd.xauicfg[macidx(mac)] | in xaui_serdes_reset() 70 void t3b_pcs_reset(struct cmac *mac) in t3b_pcs_reset() argument [all …]
|
/linux/drivers/net/wireless/zydas/zd1211rw/ |
H A D | zd_mac.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* ZD1211 USB-WLAN driver for Linux 4 * Copyright (C) 2005-2007 Ulrich Kunitz <kune@deine-taler.de> 5 * Copyright (C) 2006-2007 Daniel Drake <dsd@gentoo.org> 6 * Copyright (C) 2006-2007 Michael Wu <flamingice@sourmilk.net> 7 * Copyright (C) 2007-2008 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu> 86 * - packet is sent using 4 different rates 87 * - 1st rate is index 3 (ie 11 Mbits) 88 * - 2nd rate is index 2 (ie 5.5 Mbits) 89 * - 3rd rate is index 1 (ie 2 Mbits) [all …]
|
/linux/drivers/net/ethernet/pasemi/ |
H A D | pasemi_mac.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2006-2007 PA Semi, Inc 17 #include <asm/dma-mapping.h> 40 * - Multicast support 41 * - Large MTU support 42 * - Multiqueue RX/TX 63 static int debug = -1; /* -1 == use DEFAULT_MSG_ENABLE as value */ 65 MODULE_PARM_DESC(debug, "PA Semi MAC bitmapped debugging message enable value"); 83 static unsigned int read_mac_reg(const struct pasemi_mac *mac, unsigned int reg) in read_mac_reg() argument 85 return pasemi_read_mac_reg(mac->dma_if, reg); in read_mac_reg() [all …]
|
/linux/drivers/net/wireless/quantenna/qtnfmac/ |
H A D | core.c | 1 // SPDX-License-Identifier: GPL-2.0+ 2 /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 42 struct qtnf_wmac *mac = NULL; in qtnf_core_get_mac() local 45 pr_err("invalid MAC index %u\n", macid); in qtnf_core_get_mac() 50 mac = bus->mac[macid]; in qtnf_core_get_mac() 52 if (unlikely(!mac)) { in qtnf_core_get_mac() 53 pr_err("MAC%u: not initialized\n", macid); in qtnf_core_get_mac() 57 return mac; in qtnf_core_get_mac() 81 struct qtnf_vif *vif = qtnf_netdev_get_priv(skb->dev); in qtnf_packet_send_hi_pri() 83 skb_queue_tail(&vif->high_pri_tx_queue, skb); in qtnf_packet_send_hi_pri() [all …]
|
H A D | cfg80211.c | 1 // SPDX-License-Identifier: GPL-2.0+ 2 /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 78 struct qtnf_wmac *mac; in qtnf_validate_iface_combinations() local 86 mac = wiphy_priv(wiphy); in qtnf_validate_iface_combinations() 87 if (!mac) in qtnf_validate_iface_combinations() 88 return -EFAULT; in qtnf_validate_iface_combinations() 91 vif = &mac->iflist[i]; in qtnf_validate_iface_combinations() 92 if (vif->wdev.iftype != NL80211_IFTYPE_UNSPECIFIED) in qtnf_validate_iface_combinations() 93 params.iftype_num[vif->wdev.iftype]++; in qtnf_validate_iface_combinations() 98 params.iftype_num[change_vif->wdev.iftype]--; in qtnf_validate_iface_combinations() [all …]
|
H A D | commands.c | 1 // SPDX-License-Identifier: GPL-2.0+ 2 /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 25 if (unlikely(le16_to_cpu(resp->cmd_id) != cmd_id)) { in qtnf_cmd_check_reply_header() 27 mac_id, vif_id, cmd_id, le16_to_cpu(resp->cmd_id)); in qtnf_cmd_check_reply_header() 28 return -EINVAL; in qtnf_cmd_check_reply_header() 31 if (unlikely(resp->macid != mac_id)) { in qtnf_cmd_check_reply_header() 32 pr_warn("VIF%u.%u CMD%x: bad MAC in response: %u\n", in qtnf_cmd_check_reply_header() 33 mac_id, vif_id, cmd_id, resp->macid); in qtnf_cmd_check_reply_header() 34 return -EINVAL; in qtnf_cmd_check_reply_header() 37 if (unlikely(resp->vifid != vif_id)) { in qtnf_cmd_check_reply_header() [all …]
|
H A D | event.c | 1 // SPDX-License-Identifier: GPL-2.0+ 2 /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 19 qtnf_event_handle_sta_assoc(struct qtnf_wmac *mac, struct qtnf_vif *vif, in qtnf_event_handle_sta_assoc() argument 34 mac->macid, vif->vifid, len, sizeof(*sta_assoc)); in qtnf_event_handle_sta_assoc() 35 return -EINVAL; in qtnf_event_handle_sta_assoc() 38 if (vif->wdev.iftype != NL80211_IFTYPE_AP) { in qtnf_event_handle_sta_assoc() 40 mac->macid, vif->vifid); in qtnf_event_handle_sta_assoc() 41 return -EPROTO; in qtnf_event_handle_sta_assoc() 46 return -ENOMEM; in qtnf_event_handle_sta_assoc() 48 sta_addr = sta_assoc->sta_addr; in qtnf_event_handle_sta_assoc() [all …]
|
/linux/drivers/net/ethernet/stmicro/stmmac/ |
H A D | dwmac-ingenic.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * dwmac-ingenic.c - Ingenic SoCs DWMAC specific glue layer 75 struct ingenic_mac *mac = plat_dat->bsp_priv; in ingenic_mac_init() local 78 if (mac->soc_info->set_mode) { in ingenic_mac_init() 79 ret = mac->soc_info->set_mode(plat_dat); in ingenic_mac_init() 89 struct ingenic_mac *mac = plat_dat->bsp_priv; in jz4775_mac_set_mode() local 92 switch (plat_dat->mac_interface) { in jz4775_mac_set_mode() 96 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_MII\n"); in jz4775_mac_set_mode() 102 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_GMII\n"); in jz4775_mac_set_mode() 108 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in jz4775_mac_set_mode() [all …]
|
H A D | hwif.c | 1 // SPDX-License-Identifier: (GPL-2.0 OR MIT) 14 u32 reg = readl(priv->ioaddr + id_reg); in stmmac_get_id() 17 dev_info(priv->device, "Version ID not available\n"); in stmmac_get_id() 21 dev_info(priv->device, "User ID: 0x%x, Synopsys ID: 0x%x\n", in stmmac_get_id() 29 u32 reg = readl(priv->ioaddr + id_reg); in stmmac_get_dev_id() 32 dev_info(priv->device, "Version ID not available\n"); in stmmac_get_dev_id() 41 struct mac_device_info *mac = priv->hw; in stmmac_dwmac_mode_quirk() local 43 if (priv->chain_mode) { in stmmac_dwmac_mode_quirk() 44 dev_info(priv->device, "Chain mode enabled\n"); in stmmac_dwmac_mode_quirk() 45 priv->mode = STMMAC_CHAIN_MODE; in stmmac_dwmac_mode_quirk() [all …]
|
/linux/drivers/net/wireless/purelifi/plfxlc/ |
H A D | mac.c | 1 // SPDX-License-Identifier: GPL-2.0-only 14 #include "mac.h" 87 struct plfxlc_mac *mac = plfxlc_hw_mac(hw); in plfxlc_mac_init_hw() local 88 struct plfxlc_chip *chip = &mac->chip; in plfxlc_mac_init_hw() 93 dev_warn(plfxlc_mac_dev(mac), "init hw failed (%d)\n", r); in plfxlc_mac_init_hw() 97 dev_dbg(plfxlc_mac_dev(mac), "irq_disabled (%d)\n", irqs_disabled()); in plfxlc_mac_init_hw() 98 regulatory_hint(hw->wiphy, "00"); in plfxlc_mac_init_hw() 102 void plfxlc_mac_release(struct plfxlc_mac *mac) in plfxlc_mac_release() argument 104 plfxlc_chip_release(&mac->chip); in plfxlc_mac_release() 105 lockdep_assert_held(&mac->lock); in plfxlc_mac_release() [all …]
|
/linux/drivers/net/ethernet/chelsio/cxgb/ |
H A D | vsc7326.c | 1 // SPDX-License-Identifier: GPL-2.0 4 /* Driver for Vitesse VSC7326 (Schaumburg) MAC */ 16 * interface is down (MAC port disabled). This is a workaround 17 * for disabling the T2/MAC flow-control. When the interface is 40 spin_lock_bh(&adapter->mac_lock); in vsc_read() 50 pr_err("Invalid tpi read from MAC, breaking loop.\n"); in vsc_read() 60 spin_unlock_bh(&adapter->mac_lock); in vsc_read() 65 spin_lock_bh(&adapter->mac_lock); in vsc_write() 71 spin_unlock_bh(&adapter->mac_lock); in vsc_write() 74 /* Hard reset the MAC. This wipes out *all* configuration. */ [all …]
|
/linux/drivers/net/ethernet/microchip/lan966x/ |
H A D | lan966x_mdb.c | 1 // SPDX-License-Identifier: GPL-2.0+ 16 unsigned char mac[ETH_ALEN]; member 25 INIT_LIST_HEAD(&lan966x->mdb_entries); in lan966x_mdb_init() 26 INIT_LIST_HEAD(&lan966x->pgid_entries); in lan966x_mdb_init() 33 list_for_each_entry_safe(mdb_entry, tmp, &lan966x->mdb_entries, list) { in lan966x_mdb_purge_mdb_entries() 34 list_del(&mdb_entry->list); in lan966x_mdb_purge_mdb_entries() 43 list_for_each_entry_safe(pgid_entry, tmp, &lan966x->pgid_entries, list) { in lan966x_mdb_purge_pgid_entries() 44 list_del(&pgid_entry->list); in lan966x_mdb_purge_pgid_entries() 57 const unsigned char *mac, in lan966x_mdb_entry_get() argument 62 list_for_each_entry(mdb_entry, &lan966x->mdb_entries, list) { in lan966x_mdb_entry_get() [all …]
|
H A D | lan966x_mac.c | 1 // SPDX-License-Identifier: GPL-2.0+ 17 #define LAN966X_MAC_INVALID_ROW -1 21 unsigned char mac[ETH_ALEN] __aligned(2); member 53 const unsigned char mac[ETH_ALEN], in lan966x_mac_select() 58 /* Set the MAC address to handle and the vlan associated in a format in lan966x_mac_select() 62 mach |= mac[0] << 8; in lan966x_mac_select() 63 mach |= mac[1] << 0; in lan966x_mac_select() 64 macl |= mac[2] << 24; in lan966x_mac_select() 65 macl |= mac[3] << 16; in lan966x_mac_select() 66 macl |= mac[4] << 8; in lan966x_mac_select() [all …]
|
/linux/arch/m68k/include/uapi/asm/ |
H A D | bootinfo-mac.h | 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 3 ** asm/bootinfo-mac.h -- Macintosh-specific boot information definitions 11 * Macintosh-specific tags (all __be32) 14 #define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */ 15 #define BI_MAC_VADDR 0x8001 /* Mac video base address */ 16 #define BI_MAC_VDEPTH 0x8002 /* Mac video depth */ 17 #define BI_MAC_VROW 0x8003 /* Mac video rowbytes */ 18 #define BI_MAC_VDIM 0x8004 /* Mac video dimensions */ 19 #define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */ 20 #define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */ [all …]
|
/linux/drivers/net/ethernet/sunplus/ |
H A D | spl2sw_driver.c | 1 // SPDX-License-Identifier: GPL-2.0 7 #include <linux/nvmem-consumer.h> 27 struct spl2sw_mac *mac = netdev_priv(ndev); in spl2sw_ethernet_open() local 28 struct spl2sw_common *comm = mac->comm; in spl2sw_ethernet_open() 31 netdev_dbg(ndev, "Open port = %x\n", mac->lan_port); in spl2sw_ethernet_open() 33 comm->enable |= mac->lan_port; in spl2sw_ethernet_open() 38 mask = readl(comm->l2sw_reg_base + L2SW_SW_INT_MASK_0); in spl2sw_ethernet_open() 40 writel(mask, comm->l2sw_reg_base + L2SW_SW_INT_MASK_0); in spl2sw_ethernet_open() 42 phy_start(ndev->phydev); in spl2sw_ethernet_open() 51 struct spl2sw_mac *mac = netdev_priv(ndev); in spl2sw_ethernet_stop() local [all …]
|
H A D | spl2sw_mac.c | 1 // SPDX-License-Identifier: GPL-2.0 20 if (comm->enable == 0) { in spl2sw_mac_hw_stop() 22 writel(0xffffffff, comm->l2sw_reg_base + L2SW_SW_INT_MASK_0); in spl2sw_mac_hw_stop() 23 writel(0xffffffff, comm->l2sw_reg_base + L2SW_SW_INT_STATUS_0); in spl2sw_mac_hw_stop() 26 reg = readl(comm->l2sw_reg_base + L2SW_CPU_CNTL); in spl2sw_mac_hw_stop() 28 writel(reg, comm->l2sw_reg_base + L2SW_CPU_CNTL); in spl2sw_mac_hw_stop() 32 reg = readl(comm->l2sw_reg_base + L2SW_PORT_CNTL0); in spl2sw_mac_hw_stop() 33 reg |= FIELD_PREP(MAC_DIS_PORT, ~comm->enable); in spl2sw_mac_hw_stop() 34 writel(reg, comm->l2sw_reg_base + L2SW_PORT_CNTL0); in spl2sw_mac_hw_stop() 42 reg = readl(comm->l2sw_reg_base + L2SW_CPU_CNTL); in spl2sw_mac_hw_start() [all …]
|
/linux/drivers/net/ethernet/microchip/sparx5/ |
H A D | sparx5_mactable.c | 1 // SPDX-License-Identifier: GPL-2.0+ 14 /* Commands for Mac Table Command register */ 18 #define MAC_CMD_READ 3 /* Read entry at Mac Table Index */ 19 #define MAC_CMD_WRITE 4 /* Write entry at Mac Table Index */ 35 unsigned char mac[ETH_ALEN]; member 60 const unsigned char mac[ETH_ALEN], in sparx5_mact_select() 65 /* Set the MAC address to handle and the vlan associated in a format in sparx5_mact_select() 69 mach |= mac[0] << 8; in sparx5_mact_select() 70 mach |= mac[1] << 0; in sparx5_mact_select() 71 macl |= mac[2] << 24; in sparx5_mact_select() [all …]
|
/linux/drivers/net/ethernet/freescale/enetc/ |
H A D | enetc_hw.h | 1 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ 2 /* Copyright 2017-2019 NXP */ 46 /* VF-PF Message passing */ 109 /** SI BDR sub-blocks, n = 0..7 */ 303 /* Port MAC counters: Port MAC 0 corresponds to the eMAC and 304 * Port MAC 1 to the pMAC. 306 #define ENETC_PM_REOCT(mac) (0x8100 + ENETC_PMAC_OFFSET * (mac)) argument 307 #define ENETC_PM_RALN(mac) (0x8110 + ENETC_PMAC_OFFSET * (mac)) argument 308 #define ENETC_PM_RXPF(mac) (0x8118 + ENETC_PMAC_OFFSET * (mac)) argument 309 #define ENETC_PM_RFRM(mac) (0x8120 + ENETC_PMAC_OFFSET * (mac)) argument [all …]
|
H A D | enetc_ethtool.c | 1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2 /* Copyright 2017-2019 NXP */ 44 struct enetc_hw *hw = &priv->si->hw; in enetc_get_reglen() 48 len += ARRAY_SIZE(enetc_txbdr_regs) * priv->num_tx_rings; in enetc_get_reglen() 49 len += ARRAY_SIZE(enetc_rxbdr_regs) * priv->num_rx_rings; in enetc_get_reglen() 51 if (hw->port) in enetc_get_reglen() 54 if (hw->port && !!(priv->si->hw_features & ENETC_SI_F_QBU)) in enetc_get_reglen() 66 struct enetc_hw *hw = &priv->si->hw; in enetc_get_regs() 76 for (i = 0; i < priv->num_tx_rings; i++) { in enetc_get_regs() 85 for (i = 0; i < priv->num_rx_rings; i++) { in enetc_get_regs() [all …]
|
/linux/net/core/ |
H A D | of_net.c | 1 // SPDX-License-Identifier: GPL-2.0-only 15 #include <linux/nvmem-consumer.h> 18 * of_get_phy_mode - Get phy mode for given device_node 22 * The function gets phy interface string from property 'phy-mode' or 23 * 'phy-connection-type'. The index in phy_modes table is set in 25 * PHY_INTERFACE_MODE_NA and an errno is returned, e.g. -ENODEV. 34 err = of_property_read_string(np, "phy-mode", &pm); in of_get_phy_mode() 36 err = of_property_read_string(np, "phy-connection-type", &pm); in of_get_phy_mode() 46 return -ENODEV; in of_get_phy_mode() 54 if (pp && pp->length == ETH_ALEN && is_valid_ether_addr(pp->value)) { in of_get_mac_addr() [all …]
|
/linux/drivers/net/wireless/realtek/rtlwifi/ |
H A D | core.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* Copyright(c) 2009-2012 Realtek Corporation.*/ 82 if (rtlpriv->cfg->alt_fw_name) { in rtl_fw_do_work() 84 rtlpriv->cfg->alt_fw_name, in rtl_fw_do_work() 85 rtlpriv->io.dev); in rtl_fw_do_work() 87 rtlpriv->cfg->alt_fw_name); in rtl_fw_do_work() 92 rtlpriv->max_fw_size = 0; in rtl_fw_do_work() 96 if (firmware->size > rtlpriv->max_fw_size) { in rtl_fw_do_work() 102 memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, in rtl_fw_do_work() 103 firmware->size); in rtl_fw_do_work() [all …]
|
/linux/drivers/net/ethernet/intel/e1000e/ |
H A D | mac.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* Copyright(c) 1999 - 2018 Intel Corporation. */ 9 * e1000e_get_bus_info_pcie - Get PCIe bus information 18 struct pci_dev *pdev = hw->adapter->pdev; in e1000e_get_bus_info_pcie() 19 struct e1000_mac_info *mac = &hw->mac; in e1000e_get_bus_info_pcie() local 20 struct e1000_bus_info *bus = &hw->bus; in e1000e_get_bus_info_pcie() 24 bus->width = e1000_bus_width_unknown; in e1000e_get_bus_info_pcie() 27 bus->width = (enum e1000_bus_width)FIELD_GET(PCI_EXP_LNKSTA_NLW, in e1000e_get_bus_info_pcie() 31 mac->ops.set_lan_id(hw); in e1000e_get_bus_info_pcie() 37 * e1000_set_lan_id_multi_port_pcie - Set LAN id for PCIe multiple port devices [all …]
|
/linux/arch/arm64/crypto/ |
H A D | sm4-ce-ccm-glue.c | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 3 * SM4-CCM AEAD Algorithm using ARMv8 Crypto Extensions 19 #include "sm4-ce.h" 21 asmlinkage void sm4_ce_cbcmac_update(const u32 *rkey_enc, u8 *mac, 24 u8 *iv, unsigned int nbytes, u8 *mac); 26 u8 *iv, unsigned int nbytes, u8 *mac); 27 asmlinkage void sm4_ce_ccm_final(const u32 *rkey_enc, u8 *iv, u8 *mac); 36 return -EINVAL; in ccm_setkey() 39 sm4_ce_expand_key(key, ctx->rkey_enc, ctx->rkey_dec, in ccm_setkey() 49 return -EINVAL; in ccm_setauthsize() [all …]
|
/linux/drivers/net/ethernet/intel/ice/ |
H A D | ice_fltr.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* Copyright (C) 2018-2020, Intel Corporation. */ 8 * ice_fltr_free_list - free filter lists helper 20 list_del(&e->list_entry); in ice_fltr_free_list() 26 * ice_fltr_add_entry_to_list - allocate and add filter entry to list 29 * @list: pointer to the list which contains MAC filters entry 39 return -ENOMEM; in ice_fltr_add_entry_to_list() 41 entry->fltr_info = *info; in ice_fltr_add_entry_to_list() 43 INIT_LIST_HEAD(&entry->list_entry); in ice_fltr_add_entry_to_list() 44 list_add(&entry->list_entry, list); in ice_fltr_add_entry_to_list() [all …]
|