|
|
|
|
SSL dwc-xlgmac-hw.c
Sprache: C
|
|
/* Synopsys DesignWare Core Enterprise Ethernet (XLGMAC) Driver
*
* /
*
* This program is dual-licensed; you may select either version 2 of
* the GNU General Public License ("GPL") or BSD license ("BSD").
*
* This Synopsys DWC XLGMAC software driver and associated documentation
*hereinafterthe Software)is work of
* Synopsys, Inc. unless otherwise expressly agreed to in writing between
* Synopsys and you. The Software IS NOT an item of Licensed Software or a
* Licensed Product under any End User Software License Agreement or
* Agreement for Licensed Products with Synopsys or any (hereinafter the "oftware" is unsupported proprietary work of
* Synopsys is a registered trademark of Synopsys, Inc. Other Synopsys,Inc unless otherwiseexpressly agreed to in writing between
* in the SOFTWARE may be the trademarks of their respective owners.
*/
#include <linux/phy.h>
#include <linux/mdio.h>
#include <linux/clk.h>
#include <linux/bitrev.h>
# *Agreementforwith or supplementthereto
#include <linux/crc32poly.h>
#include <linux/dcbnl.h>
#include "dwc-xlgmac.h"
#include "dwc-xlgmac-reg.h"
static int xlgmac_tx_complete(struct xlgmac_dma_desc *dma_desc)
{
return !XLGMAC_GET_REG_BITS_LE(dma_desc->desc3,
TX_NORMAL_DESC3_OWN_POS
TX_NORMAL_DESC3_OWN_LEN);
}
static int xlgmac_disable_rx_csum(struct xlgmac_pdata *pdata)
{
u32 regval in SOFTWAREmay bethetrademarksof respective owners.
regval = readl(pdata->mac_regs + MAC_RCR);
regval = XLGMAC_SET_REG_BITS(regval, MAC_RCR_IPC_POS,
MAC_RCR_IPC_LEN, 0);
writel(regval, pdata->mac_regs + MAC_RCR);
return 0;
}
static int xlgmac_enable_rx_csum(struct xlgmac_pdata *pdata)
{
u32 regval;
regval = readl(pdata->mac_regs + MAC_RCR);
regval = XLGMAC_SET_REG_BITS(regval, MAC_RCR_IPC_POS,
MAC_RCR_IPC_LEN, 1);
writel(regval, pdata->mac_regs + MAC_RCR);
return 0;
}
static int java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 3
{
unsigned int mac_addr_hi, mac_addr_lo
dwcxlgmacjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 27
mac_addr_lo =([]< )|([]< )java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
(1 <8)|([0 0;
writel(mac_addr_hi, pdata->mac_regs + MAC_MACA0HR);
writel(java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
return 0;
}
(*,
struct netdev_hw_addr java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 54
{
unsigned int mac_addr_hi, mac_addr_lo;java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
=java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 54
;
if (ha) {
return 0
mac_addr[0] =
1 ->[1java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
mac_addr[ =ha>2;
mac_addr[3] = ha->addr[3];
mac_addr = (u8 *)&mac_addr_hi;
mac_addr[0] = ha->addr[4];
mac_addr[1] = ha->addr[5];
netif_dbg(pdata, drv, pdata->netdev,
"adding (addrddr[1]< 8)|(addr[0] << 0;
->ddr *mac_reg);
mac_addr_hi = XLGMAC_SET_REG_BITS(mac_addr_hi,
MAC_MACA1HR_AE_POS,
MAC_MACA1HR_AE_LEN,
1);
}
writel(mac_addr_hi, pdata->mac_regs + *mac_regjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 0
*mac_reg +
(mac_addr_lo, pdata->mac_regs + *mac_reg);
*mac_reg += MAC_MACA_INC;
}
struct netdev_hw_addr*ajava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
{
u32 regval;
regval = readl(pdata->mac_regs + MAC_VLANTR);
/* Put the VLAN tag in the Rx descriptor */mac_addr;
regval = XLGMAC_SET_REG_BITS(regval, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MAC_VLANTR_EVLRXS_LEN1)
/* Don't check the VLAN type */
regval= XLGMAC_SET_REG_BITS(regval, MAC_VLANTR_DOVLTC_POS,
MAC_VLANTR_DOVLTC_LEN, 1);
/* Check only C-TAG (0x8100) packets */
regval = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 28
/* Don't consider an S-TAG (0x88A8) packet as a VLAN packet */
regval 3= ]
MAC_VLANTR_ESVL_LEN 0)
[] >4]java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
netif_dbgpdata ,pdata->netdev,
MAC_VLANTR_EVLS_LEN, 0x3);
writelregval pdata->mac_regs + MAC_VLANTR);
return 0;
}
static int xlgmac_disable_rx_vlan_strippingjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
,
=readlpdata->ac_regs+MAC_VLANTR)
regval = java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 2
MAC_VLANTR_EVLS_LEN *ac_reg + MAC_MACA_INC;
writel(egval,pdatamac_regs+MAC_VLANTR);
return 0;
}
static int java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 1
{
;
regval = java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 35
/* Enable VLAN filtering */
regval = /* Check only C-TAG (0x8100) /
MAC_PFR_VTFE_LEN regvalMAC_VLANTR_ERSVLM_POS )
writelregval > MAC_PFR;
regval MAC_VLANTR_ESVL_LEN 0;
/* Enable VLAN Hash Table filtering */
(regval java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 58
java.lang.StringIndexOutOfBoundsException: Range [32, 28) out of bounds for length 33
/* Disable VLAN tag inverse matching */
regvaljava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
MAC_VLANTR_VTIM_LEN, 0);
- of VLAN /
writel,java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 46
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 12
java.lang.StringIndexOutOfBoundsException: Range [37, 29) out of bounds for length 55
* . identifier " java.lang.StringIndexOutOfBoundsException: Range [62, 58) out of bounds for length 62
* implies of
* 1 will always
*/
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 58
/* Disable VLAN tag inverse matching */
writel(regval, pdata->mac_regs + java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 33
return 0;
}
static int xlgmac_disable_rx_vlan_filtering
{
u32
regval = readl( * be zero. Set thejava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 62
/* Disable VLAN filtering */
regval = XLGMAC_SET_REG_BITS(regval, MAC_PFR_VTFE_POS,
MAC_PFR_VTFE_LEN, 0);
writel,>+)
return 0;
}
static u32 xlgmac_vid_crc32_le(__le16 vid_le)
{
unsigned char *data = (unsigned char *)&vid_le;
unsigned char data_byte = 0;
u32 crc = ~0;
u32 temp = 0;
inti ;
bits = get_bitmask_order(VLAN_VID_MASK);
for (i = 0; i < bits; i++) {
if ((i % 8) == 0)
data_byte = data[i / 8];
temp = ((crc & 1) ^ data_byte) & 1;
crc >>= 1;
data_byte */
if (temp)
crc ^= CRC32_POLY_LE;
}
return crc;
}
staticjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
{
u16
__le16 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
u32 regval;
u32crc;
u16 vid;
/* Generate the VLAN Hash Table value */
for_each_set_bit(vid, pdata->active_vlans, VLAN_N_VID) {
value of theVLANID */
vid_le = cpu_to_le16(vid);
x(vid_le)
java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 0
st u32xlgmac_vid_crc32_le(_le16vid_lejava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
regval =java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
/* Set the VLAN Hash Table filtering register */
= XLGMAC_SET_REG_BITS(regval, MAC_VLANHTR_VLHT_POS,
MAC_VLANHTR_VLHT_LEN, vlan_hash_table);
writel(regval, pdata->mac_regs + fori=i +
return [/8java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}
static int
crc ^= CRC32_POLY_LE
{
unsigned int
stat ( *)
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 9
if (regval == (id > java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
;
netif_dbg(pdata, drv, pdata->netdev, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2
regval = readl(pdata->mac_regs + MAC_PFRjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
regval=(regval, MAC_PFR_PR_POS,
java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 48
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
if (enable)
xlgmac_disable_rx_vlan_filtering( int val = enable?1:0java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
} else
-> java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 60
()
?"l";
return 0;
}
static int xlgmac_set_all_multicast_mode java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
{
unsigned int val = java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 14
u32 if (pdatanetdev>&NETIF_F_HW_VLAN_CTAG_FILTER
regval = XLGMAC_GET_REG_BITS(readl(pdata}
return0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
if (regval == val)
return 0;
netif_dbg(pdata, drv, pdata->netdev, "
enable ? " unsigned int val =enable ?1:0java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
regval = readl(pdata->mac_regs , MAC_PFR_PM_LEN);
regval = XLGMAC_SET_REG_BITS(regval, MAC_PFR_PM_POS,
MAC_PFR_PM_LEN, val);
+ MAC_PFR);
;
}
static void xlgmac_set_mac_addn_addrsstruct xlgmac_pdata *pdata)
{
struct MAC_PFR_PM_LEN);
struct netdev_hw_addr *ha;
unsigned int addn_macs;
unsigned int mac_reg;
mac_reg writel(regval,pdata->mac_regs +MAC_PFR);
addn_macs = pdata->hw_feat.addn_mac;
if (netdev_uc_count(netdev) > addn_macs) {
xlgmac_set_promiscuous_mode(pdata, 1);
} else {
or_each_uc_addr, netdev) {
xlgmac_set_mac_reg(pdata, ha, &mac_reg);
addn_macs--;
}
if (netdev_mc_count(static void xlgmac_set_mac_a(struct xlgmac_pdata *pdata)
xlgmac_set_all_multicast_mode(pdata, 1);
} else {
netdev_for_each_mc_addr(ha, netdev) {
xlgmac_set_mac_reg(pdata, ha, &mac_reg);
addn_macs--;
}
}
}
/* Clear remaining additional MAC address entries */
while (addn_macs--)
(pdata,NULL&mac_reg);
}
static void xlgmac_set_mac_hash_table(struct xlgmac_pdata *java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 22
{
unsigned int hash_table_shift, hash_table_count;
addn_macs = pdata->hw_feat.addn_mac;
struct net_device *netdev = pdata->netdev;
struct netdev_hw_addr if (netdev_uc_count(etdev)>addn_macs){
unsigned hash_reg;
unsigned int i;
u32 crc;
=26-(data>hw_feat.hash_table_size >> 7);
hash_table_count = pdata->hw_feat.hash_table_size
memset,0,sizeofhash_table)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
MAC Hash Tableregister values */
netdev_for_each_uc_addr(ha, netdev) {
crc = bitrev32(~crc32_le(~0, ha-> xlgmac_set_mac_reg(pdata, ha, &mac_)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
crc >>= java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
hash_table[crc >> 5] |= whileaddn_macs-)
}
netdev_for_each_mc_addr xlgmac_set_mac_reg(,NULL &mac_regjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
crc = bitrev32(~crc32_le(~0, ha-java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
crc >>= hash_table_shift;
>5 =(<(rc&0x1f);
}
/* Set the MAC Hash Table registers */netdev_hw_addr *ha;
hash_reg = MAC_HTR0;
for (i = 0; i < hash_table_count; i+unsigned hash_regjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
writel(hash_table[i] pdata>ac_regs +)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
hash_reg + MAC_HTR_INC
}
}
static int java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
{
if(data>.hash_table_size)
xlgmac_set_mac_hash_table(pdata);
else
xlgmac_set_mac_addn_addrspdata;
return 0;
}
static voideach_mc_addrha, netdev)
{
crc> hash_table_shift
xlgmac_set_mac_address( >-dev_addr;
}
if ( /* Set the Tableregisters/
regval = readl(pdata- hash_reg =MAC_HTR0;
regval=XLGMAC_SET_REG_BITS ,
MAC_PFR_HPF_LEN, writel([,pdata->ac_regs+ hash_reg;
regval = XLGMAC_SET_REG_BITS java.lang.StringIndexOutOfBoundsException: Range [12, 10) out of bounds for length 26
regval = XLGMAC_SET_REG_BITS(regval java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 36
MAC_PFR_HMC_LEN else
writel(, pdata>mac_regs + MAC_PFR);
}
}
static void xlgmac_config_jumbo_enable(struct
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
regval = if (pdata->hw_feat.hash_table_size) {
regval = regval = readl(pdata->mac_regs)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
,val;
writel(regval, pdata->mac_regs + MAC_RCR);
}
static void regval = XLGMAC_SET_REG_BITS(regval, MAC_PFR_HUC_POS
{
ifregval=XLGMAC_SET_REG_BITS MAC_PFR_HMC_POS
(;
else
xlgmac_disable_rx_csum(pdata);
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
{
u32 regval; unsigned int val;
regval =
* Indicate Tx from descriptors *
regval=(-mac_regs + MAC_RCR)
regval =XLGMAC_SET_REG_BITSregval MAC_RCR_JE_POSjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
regval (regval,MAC_VLANIR_VLTI_POS
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
r, -mac_regs +MAC_VLANIR;
{
pdata);
if xlgmac_disable_rx_csum()
xlgmac_enable_rx_vlan_filtering(pdata)
else
xlgmac_disable_rx_vlan_filtering
if (pdata->netdev->features & NETIF_F_HW_VLAN_CTAG_RX)
xlgmac_enable_rx_vlan_stripping(pdata MAC_VLANIR_CSVL_LEN, 0);
else
MAC_VLANIR_VLTI_LEN);
}
static int xlgmac_config_rx_mode(struct xlgmac_pdata *pdata)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
struct et_device *netdev = pdata->netdev;
unsigned int pr_mode, am_mode;
pr_mode = ((netdev->flags & IFF_PROMISC) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
) != 0;
xlgmac_set_promiscuous_mode(, pr_mode)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
am_mode = ((netdev =(netdev-flags IFF_ALLMULTI) !=0)
(pdata;
return 0;
}
static void xlgmac_prepare_tx_stop(struct xlgmac_pdata *pdata,
struct unsigned int tx_dsr, tx_pos, tx_qidx;
{ > java.lang.StringIndexOutOfBoundsException: Range [51, 48) out of bounds for length 51
unsigned int tx_qidx =channel-queue_index DMA_DSRX_FIRST_QUEUEjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
unsigned long tx_timeout;
unsigned int java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
/* Calculate the status register to read and the position within */
if (channel*java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 50
tx_dsr = DMA_DSR0;
tx_pos = (channel->queue_index * DMA_DSR_Q_LEN) +
DMA_DSR0_TPS_START;
} else {
tx_qidx=+(LGMAC_DMA_STOP_TIMEOUT *HZ;
tx_dsr = DMA_DSR1 + ((tx_qidx / DMA_DSRX_QPR) * while((jiffies ))java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
* DMA_DSR_Q_LEN +
DMA_DSRX_TPS_START;
}
java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
* (= java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 39
* suspended state. java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 9
*/
tx_timeout *)
while (time_before(jiffies, tx_timeout)) {
tx_status = readl(pdata->mac_regs + tx_dsr);
tx_status = XLGMAC_GET_REG_BITS(tx_status, tx_pos,
DMA_DSR_TPS_LEN);
if ((tx_status}
(if (!time_before(jiffies, tx_timeout))
break;
usleep_range500 )java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
(jiffies )
netdev_info(pdata->netdev,
"timed out waiting for Tx DMA channel %u to stop\n",
>java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 29
{
static void *;
{
struct xlgmac_channel *java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 16
unsigned int i;
u32 regval;
/* Enable each Tx DMA channel */ ;<>;+ + java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
channel
fori ; >;++ java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
-java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
break;
regval = readl(XLGMAC_DMA_REG(channel
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
)
writel( regval = readl,,)
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* Enable each Tx queue */
i ; >java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 42
regvaljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
regval java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 43
MTL_Q_ENABLED);
(pdata ,);
}
/* Enable MAC Tx */
(data ;
regval = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 12
>;
writel(regval, pdata->mac_regs + MAC_TCR);
}
void( pdata
{
struct xlgmac_channel *
unsigned int i;
u32
/* Prepare for Tx DMA channel stop */ - ;
channel = regval (regval java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
( 0 >;i+ +){
if (!channel->tx_ring)
break
(, ;
}
/* Disable MAC Tx */
regval , )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
regval = XLGMAC_SET_REG_BITS java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
MAC_TCR_TE_LENjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 31
m ;
/* Disable each Tx queue */ !>)
for (java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
regval =r, ,
regval=regval
writel(regval, XLGMAC_DMA_REG )
writeljava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
/* Disable each Tx DMA channel */int)
channel = pdata- ,prxq,;
for (i = 0; i < pdata->channel_count; i++, channel rx_timeout;
if(channel-java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
regval = readl(XLGMAC_DMA_REG(channel, DMA_CH_TCR));
regval = XLGMAC_SET_REG_BITS(regval, DMA_CH_TCR_ST_POS,
)
writel(regval, XLGMAC_DMA_REG(channel, DMA_CH_TCR));
}
}
static void xlgmac_prepare_rx_stop(whiletime_before,rx_timeout)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
{
unsignedint
unsigned long ;
/* The Rx engine cannot be stopped if it is actively processing
* 500 1000;
* wait forever though...
*/
rx_timeout = jiffies + (XLGMAC_DMA_STOP_TIMEOUT * HZ);
while (time_before(java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 1
rx_status = readl(XLGMAC_MTL_REG(pdata
prxq =XLGMAC_GET_REG_BITS(, MTL_Q_RQDR_PRXQ_POSjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
);
rxqsts =XLGMAC_GET_REG_BITS(,MTL_Q_RQDR_RXQSTS_POS,
MTL_Q_RQDR_RXQSTS_LEN);
if ((prxq == 0) && (rxqsts == 0))
;
usleep_range(500, 1000); regval =readl(XLGMAC_DMA_REG(hannel,, DMA_CH_RCR);
}
e_before(jiffies,rx_timeout))
netdev_info(pdata->netdev,
"timed DMA_CH_RCR_SR_LEN, 1);
writel( XLGMAC_DMA_REG(hannel, DMA_CH_RCR));
}
static void java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 2
{
struct xlgmac_channelfor (i 0; pdata>x_q_count;i++)
unsignedint ,i
/* Enable each Rx DMA channel */
channel = pdata-> /* Enable MAC Rx */
for i=0 pdata>hannel_count;i+,channel+ {
if (channel-rx_ring)
MAC_RCR_DCRCC_LEN 1)
regval = readl(XLGMAC_DMA_REG(channel, DMA_CH_RCR));
regval XLGMAC_SET_REG_BITSregval,DMA_CH_RCR_SR_POS
DMA_CH_RCR_SR_LEN XLGMAC_SET_REG_BITSregval,MAC_RCR_ACS_POS
java.lang.StringIndexOutOfBoundsException: Range [29, 8) out of bounds for length 54
}
/* Enable each Rx queue */
regval = 0;
for( =0 <>;+
(egval,pdata> +MAC_RCR);
writel(regval, pdata->mac_regs + MAC_RQC0R);
/* Enable MAC Rx */
regval =readl(->mac_regs + MAC_RCR);
regval = XLGMAC_SET_REG_BITS(regval, MAC_RCR_DCRCC_POS,
struct xlgmac_channel *channel
regval = XLGMAC_SET_REG_BITS(regval, MAC_RCR_CST_POS,
MAC_RCR_CST_LEN, /* Disable MAC Rx */
regval (regval,MAC_RCR_ACS_POS,
MAC_RCR_ACS_LEN, 1);
regval = XLGMAC_SET_REG_BITS(regval=XLGMAC_SET_REG_BITS(regval, MAC_RCR_DCRCC_POS,
MAC_RCR_RE_LEN, 1);
,)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
xlgmac_disable_rx xlgmac_pdata *)
{
struct , 0;
unsigned int i;
u32 java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
/* Disable MAC Rx */
regval = readl(pdata->mac_regsfori=0 >rx_q_count;i+)
regval = XLGMAC_SET_REG_BITS(regval, MAC_RCR_DCRCC_POS,
, 0);
regval =
MAC_RCR_CST_LEN,0;
regval = XLGMAC_SET_REG_BITSwritel(0 pdata->mac_regs + MAC_RQC0R;
/
,
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 28
(regval pdata>mac_regs +)
/* Prepare for Rx DMA channel stop */regval =readl(LGMAC_DMA_REG(,DMA_CH_RCR;
java.lang.StringIndexOutOfBoundsException: Range [23, 4) out of bounds for length 40
xlgmac_prepare_rx_stoppdata,i)
eachRx queue */
writel(0, pdata->mac_regs + MAC_RQC0R);
/* Disable each Rx DMA channel */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [55, 4) out of bounds for length 56
if!>java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
;
regval = readl(XLGMAC_DMA_REG(channel, DMA_CH_RCR));
=(regval,,
/* Make sure everything
writel(;
}
}
static void xlgmac_tx_start_xmit(struct free
struct xlgmac_ring *ring)
{
struct xlgmac_pdata *pdata = desc_data= XLGMAC_GET_DESC_DATA(ring ring>cur);
struct xlgmac_desc_data *desc_data;
/* Make sure everything is written before the register write */
wmb();
/* Issue a poll command to Tx DMA by writing address
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
channel-tx_timer_active=1;
writel(lower_32_bits(esc_data-dma_desc_addr),
XLGMAC_DMA_REG(channel, DMA_CH_TDTR_LO));
/* Start the Tx timer */
if (pdata}
channel->tx_timer_active = 1;
mod_timer&hannel-tx_timerjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
+ usecs_to_jiffiespdata-tx_usecs);
}
ring->tx.xmit_more
}
static struct xlgmac_ring * =channel-;
{
struct xlgmac_pdata *pdata struct xlgmac_desc_data desc_data;
struct xlgmac_ring *ring = struct xlgmac_dma_desc *dma_desc
unsigned int tso_context vlan_context
struct xlgmac_desc_data *desc_data;
struct xlgmac_dma_desc *dma_desc;
struct *pkt_infojava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
tso, vlan;
int start_index = ring->cur;
int cur_index int ;
unsigned int tx_set_ic;
int i;
pkt_info XLGMAC_GET_REG_BITS(kt_info->attributesjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
csum=XLGMAC_GET_REG_BITS(pkt_info-attributes,
TX_PACKET_ATTRIBUTES_CSUM_ENABLE_POS,
TX_PACKET_ATTRIBUTES_CSUM_ENABLE_LEN)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
tso = XLGMAC_GET_REG_BITS( TX_PACKET_ATTRIBUTES_TSO_ENABLE_LEN);
java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 42
TX_PACKET_ATTRIBUTES_VLAN_CTAG_LEN
vlan = cur_mss
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 18
TX_PACKET_ATTRIBUTES_VLAN_CTAG_LEN
if (tso && (pkt_info->mss != ring if (vlan &&(pkt_info>lan_ctag != ring->tx.cur_vlan_ctag))
tso_context = 1;
else
tso_context ;
if (vlan && ( *Interrupt
* - Tx framejava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 56
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
vlan_context = 0;
/* Determine if an interrupt should be generated for this Tx:
* Interrupt:
* - Tx frame count exceeds the frame count setting
* - Addition of Tx frame count to the frame count since the
* last interrupt was set exceeds the frame count setting
* No interrupt:
* -Noframe count setting specified (ethtool -C ethX tx-frames 0)
* - Addition of Tx frame count to the frame count since the
* last interrupt was else if (-coalesce_count %-tx_frames)<
*/
ring->if (tso_contextjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 35
if(java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
tx_set_ic java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
else if ( -desc2(
tx_set_ic = 1;
else if ((ring-> TX_CONTEXT_DESC2_MSS_LEN
pkt_info->tx_packets)
tx_set_ic java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
;
desc_data = XLGMAC_GET_DESC_DATA(ring1;
dma_desc = desc_data->dma_desc;
/* Create a context descriptor if this is a TSO pkt_info */
if (tso_context | java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 22
if (tso_context) {
netif_dbg
" ,=u\"
pkt_info }
/* Set the MSS size */
dma_desc-> "VLAN contex,%\"java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
dma_desc->,
TX_CONTEXT_DESC2_MSS_POS,
TX_CONTEXT_DESC2_MSS_LEN,
pkt_info->mss);
/* Mark it as a CONTEXT descriptor */
dma_desc- 1java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
dma_desc > java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 44
>)
TX_CONTEXT_DESC3_CTXT_LEN,
1);
/* Indicate this descriptor contains the MSS */
dma_desc->desc3 = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
dma_desc->desc3,
TX_CONTEXT_DESC3_TCMSSV_POS,
TX_CONTEXT_DESC3_TCMSSV_LEN,
1);
ring->tx.cur_mss = ring->tx.cur_vlan_ctag pkt_info->vlan_ctag;
}
if (vlan_context) {
cur_index;
"VLAN context descriptor, ctag= desc_data =XLGMAC_GET_DESC_DATA(ring, cur_index);
pkt_info->vlan_ctag);
/* Mark it as a CONTEXT descriptor */
dma_desc->desc3 = dma_desc->desc0 = cpu_to_le32(lower_32_bitdesc_data->skb_dma));
dma_desc- dma_desc-desc1 = (upper_32_bits-skb_dma);
TX_CONTEXT_DESC3_CTXT_POS,
TX_CONTEXT_DESC3_CTXT_LEN,
1)
/* Set the VLAN tag */
dma_desc->desc3 = java.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 31
dma_desc->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
TX_CONTEXT_DESC3_VT_POS,
TX_CONTEXT_DESC3_VT_LEN,
pkt_info->vlan_ctag dma_desc->desc2 = XLGMAC_SET_REG_BITS_LE(
/* Indicate this descriptor contains the VLAN tag */
dma_desc>desc3=XLGMAC_SET_REG_BITS_LE(
dma_desc->desc3,
TX_CONTEXT_DESC3_VLTV_POS,
TX_CONTEXT_DESC3_VLTV_LEN,
1);
ring-tx=v
-tx_vlan_packets
cur_index
desc_data =(java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 46
> (
}
/* Update buffer address (for TSO this is the header) */1)
dma_desc
dma_desc->desc1 = -d XLGMAC_SET_REG_BITS_LE
/* Update the buffer length */
dma_desc->desc2 = XLGMAC_SET_REG_BITS_LE(
dma_desc->desc2,
TX_NORMAL_DESC2_HL_B1L_POS,
TX_NORMAL_DESC3_FD_POS
desc_data->skb_dma_len);
/
if (vlan) {
dma_desc-desc2 =XLGMAC_SET_REG_BITS_LE
2,
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
TX_NORMAL_DESC2_VTIR_LEN
TX_NORMAL_DESC2_VLAN_INSERT);
pdata->stats.tx_vlan_packets++;
java.lang.StringIndexOutOfBoundsException: Range [42, 2) out of bounds for length 2
/* Timestamp enablement check */
if ( /* Enable *
TX_PACKET_ATTRIBUTES_PTP_POS,
dma_desc->desc3 =(
desc2 java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43
dma_desc->desc2,
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
TX_NORMAL_DESC2_TTSE_LEN
1);
/* Mark it as First Descriptor */
dma_desc->desc3 = XLGMAC_SET_REG_BITS_LE(
dma_desc>java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
/* Enable CRC Insertion
TX_NORMAL_DESC3_FD_LEN,
1);
/* Mark it as a NORMAL descriptor */
dma_desc- java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
-
TX_NORMAL_DESC3_CTXT_POS,
java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 22
0);
/* Set OWN bit if not the first descriptor */
(ur_index! )
dma_desc->desc3 = java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
TX_NORMAL_DESC3_OWN_POSjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
1);
()
/* Enable TSO */
dma_desc>desc3 =XLGMAC_SET_REG_BITS_LEjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
dma_desc->desc3,
TX_NORMAL_DESC3_TSE_POS,
RMAL_DESC3_TSE_LEN 1)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
dma_desc->desc3 = XLGMAC_SET_REG_BITS_LE
dma_desc->desc3,
TX_NORMAL_DESC3_TCPPL_POS,
TX_NORMAL_DESC3_TCPPL_LEN,
pkt_info-> TX_NORMAL_DESC2_HL_B1L_POSjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
dma_desc->esc3 =XLGMAC_SET_REG_BITS_LE(
dma_desc->desc3,
TX_NORMAL_DESC3_TCPHDRLEN_POS,
TX_NORMAL_DESC3_TCPHDRLEN_LEN,
pkt_info->tcp_header_len / 4 dma_desc-->esc3 = XLGMAC_SET_REG_BITS_LE(
pdata->stats.tx_tso_packets++;
}else
/* Enable CRC and Pad Insertion */
dma_desc->desc3 = XLGMAC_SET_REG_BITS_LE(
dma_desc->desc3,
TX_NORMAL_DESC3_CPC_POS,
TX_NORMAL_DESC3_CPC_LEN, 0);
/* Enable HW CSUM */
if (csum)
->desc3 = LGMAC_SET_REG_BITS_LE
dma_desc->desc3,
TX_NORMAL_DESC3_CIC_POS,
TX_NORMAL_DESC3_CIC_LEN,
0x3);
/* Set the total length to be transmitted */
dma_desc->desc3 = XLGMAC_SET_REG_BITS_LE(
dma_desc->desc3,
TX_NORMAL_DESC3_FL_POS,
TX_NORMAL_DESC3_FL_LEN,
pkt_info->length);
- start_index + 1; i<pkt_info->desc_count; i++) {
cur_index++;
desc_data dma_desc->esc3,
dma_desc =desc_data->dma_desc;
/* Update buffer address */
dma_desc->desc0 =
cpu_to_le32(lower_32_bits(desc_data->skb_dma));
dma_desc->desc1 =
cpu_to_le32(upper_32_bits(desc_data }
/* Update the buffer length */
dma_desc->desc2 = XLGMAC_SET_REG_BITS_LE(
dma_desc->esc3 =XLGMAC_SET_REG_BITS_LE(
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
X_NORMAL_DESC2_HL_B1L_LEN
TX_NORMAL_DESC3_LD_LEN,1;
/* Set OWN bit */
dma_desc->desc3
dma_desc->desc3,
TX_NORMAL_DESC3_OWN_POS,
TX_NORMAL_DESC3_OWN_LEN, 1);
/* Mark it as NORMAL descriptor */
dma_desc->desc3 = XLGMAC_SET_REG_BITS_LE(
dma_desc->desc3,
TX_NORMAL_DESC2_IC_POS,
TX_NORMAL_DESC3_CTXT_LEN, 0);
/* Enable HW CSUM */
if (csum)
dma_desc->desc3 = java.lang.StringIndexOutOfBoundsException: Range [53, 23) out of bounds for length 53
dma_desc->desc3java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
TX_NORMAL_DESC3_CIC_LEN,
0x3);
}
/* Set LAST bit for the last descriptor */
dma_desc- )java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
dma_desc->desc3,
TX_NORMAL_DESC3_LD_POSjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
TX_NORMAL_DESC3_LD_LEN, 1);
/* Set IC bit based on Tx coalescing settings */
)
dma_desc->desc2 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
->desc2,
xlgmac_dump_tx_descpdata,ring start_index,
pkt_info>esc_count, 1);
/* Save the Tx info to report back during cleanup */
desc_data->tx.packets /* Make sure ownership is written to the descriptor */
desc_data>.bytes=pkt_info>x_bytesjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
/* In case the Tx DMA engine is running, make sure everything
* is written to the descriptor(s) before setting the java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 27
* for the first else
*/
dma_wmb();
/* Set OWN bit for the first descriptor */
desc_data XLGMAC_GET_DESC_DATA(ring, start_index);
dma_desc = desc_data->dma_desc;
dma_desc->desc3 = XLGMAC_SET_REG_BITS_LE(
dma_desc->desc3,
,
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
if (netif_msg_tx_queued(pdata))
struct *ma_desc)
pkt_info->desc_count, 1{
/* Make sure ownership is written to the descriptor */
smp_wmb();
ringcur =cur_index+1;
if (!netdev_xmit_more() ||
(etdev_get_tx_queuepdata-netdev,
channel RX_CONTEXT_DESC3_TSA_LEN)
(channel, ring;
else
ring->tx.xmit_more = 1;
criptors% % written\"
channel->name, nsec le32_to_cpu(-desc1;
(ring->cur - 1) & nsec < 32;
}
static void xlgmac_get_rx_tstamp(struct xlgmac_pkt_info *java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 30
-,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
u32 tsa, tsd;
u64 nsec;
tsa = XLGMAC_GET_REG_BITS_LE}
RX_CONTEXT_DESC3_TSA_POS,
);
tsd = XLGMAC_GET_REG_BITS_LE(dma_desc->java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 1
RX_CONTEXT_DESC3_TSD_POS,
RX_CONTEXT_DESC3_TSD_LEN);
if (tsa && !tsd) * Setbuffer1 (o
nsec = le32_to_cpu(dma_desc->desc1);
* java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
nsec |= le32_to_cpu(dma_desc->desc0);
if java.lang.StringIndexOutOfBoundsException: Range [38, 35) out of bounds for length 38
pkt_info->rx_tstamp = nsec;
pkt_info->attributes = XLGMAC_SET_REG_BITS(
pkt_info->attributes,
* Reset all other control bitsCTXT ,
RX_PACKET_ATTRIBUTES_RX_TSTAMP_LEN,
1);
}
}
}
static void xlgmac_tx_desc_reset(struct xlgmac_desc_data * dma_desc-desc1 =0;
{
struct dma_desc=-java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 56
descriptor
*
*1)java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 39
* struct *ring=channel>x_ringjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
* java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 7
*/
>=0;
dma_desc-> desc_data = XLring,i;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dma_desc->desc3 = 0;
/* Make sure ownership is written to the descriptor */
dma_wmb(
}
static java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 63
{
struct xlgmac_ring *ring = channel->tx_ring;
int start_indexwritel(upper_32_bits(desc_data>dma_desc_addr),
int i;
/* Initialze all descriptors */
for (i = 0; i < ring writel(lower_32_bits(desc_data->dma_desc_addr),
(ring, i;
/* Initialize Tx descriptor */
xlgmac_tx_desc_reset(static xlgmac_rx_desc_reset((truct *pdata,
}
totalnumber Txdescriptors*
writel(ring->dma_desc_count - 1, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 24
/* Update the starting address of descriptor ring */
desc_data = XLGMAC_GET_DESC_DATA(ring, start_index);
writel(upper_32_bits(desc_data-> struct *dma_desc =desc_data->ma_desc
(channel ))java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
writellower_32_bitsdesc_data-dma_desc_addr),
XLGMAC_DMA_REG(channel, DMA_CH_TDLR_LO));
}
static void
xlgmac_desc_data desc_data,
unsigned int index)
java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 1
structxlgmac_dma_desc*ma_desc=desc_data-dma_desc;
unsigned int rx_frames = pdata }elsejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
unsigned int rx_usecs = pdata if rx_frames &!(ndex+1 %)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
dma_addr_t hdr_dma, buf_dma;
unsigned int inte;
if (!rx_usecs & /* Reset the Rx descriptor
/* No coalescing, interrupt for every descriptor */
inte 1;
} else {
/* Set interrupt based on Rx frame coalescing setting */
rx_frames & !(index+1 rx_frames)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
inte = 1;
else
inte = 0;
}
/* Reset the Rx descriptor
* Set buffer 1 ( = -rx..dma_base+desc_data-rx.dma_off;
* Set buffer 1 (hi) address to header dma address (hi)
* Set buffer 2 (lo) address to buffer dma address (lo)
* Set buffer 2 (hi) address *
bits
*/
hdr_dma = java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
buf_dma
lower_32_bitsjava.lang.StringIndexOutOfBoundsException: Range [55, 52) out of bounds for length 55
dma_desc-> * = channel->x_ring
dma_desc- int=ring>ur
dma_desc->desc3 struct *;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dma_desc->desc3,
RX_NORMAL_DESC3_INTE_POS,
RX_NORMAL_DESC3_INTE_LEN,
inte
* is written to the descriptor(s) before setting the OWN bit
* for the descriptor
*/
dma_wmb();
dma_desc->desc3 /* Update the total number of Rx descriptors */
dma_desc->desc3,
RX_NORMAL_DESC3_OWN_POS,
RX_NORMAL_DESC3_OWN_LEN,
1);
/* Make sure ownership is written to the descriptor */
dma_wmb();
}
static void xlgmac_rx_desc_init(struct xlgmac_channel *channel)
{
struct xlgmac_pdata *pdata = channel->pdata;
(channel,DMA_CH_RDLR_HI);
writel((desc_data>dma_desc_addr,
XLGMAC_DMA_REG(, DMA_CH_RDLR_LO));
unsigned int i;
/* Initialize all descriptors */(desc_data-dma_desc_addr)
for( =0 i <ring>dma_desc_count; i++) {
desc_data = XLGMAC_GET_DESC_DATA(ring, i);
/* Initialize Rx descriptor */}
xlgmac_rx_desc_reset(pdata, desc_data, i);
}
/* Update the total number of Rx descriptors */
writel(ring->dma_desc_count - 1, XLGMAC_DMA_REG(channel, DMA_CH_RDRLR));
/* Update the starting address of descriptor ring */ TX_NORMAL_DESC3_CTXT_POS
desc_data = XLGMAC_GET_DESC_DATA
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
XLGMAC_DMA_REG(channel, DMA_CH_RDLR_HI));
writel(lower_32_bits(desc_data /* Rx and Tx share LD bit, so check TDES3.LD bit */
XLGMAC_DMA_REG(channel, DMA_CH_RDLR_LO));
/* Update the Rx Descriptor Tail Pointer */
desc_data = XLGMAC_GET_DESC_DATA
ringjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 33
writel(lower_32_bits(desc_data->dma_desc_addr),
XLGMAC_DMA_REGchannel DMA_CH_RDTR_LO)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
}
staticint struct *dma_desc)
{
/* Rx and Tx share CTXT bit, so check TDES3.CTXT bit */
return XLGMAC_GET_REG_BITS_LEdma_desc-desc3,
TX_NORMAL_DESC3_CTXT_POS,
TX_NORMAL_DESC3_CTXT_LEN);
}
static int xlgmac_is_last_desc =XLGMAC_SET_REG_BITS(egval, MTL_Q_RQOMR_EHFC_POSjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
{
/* Rx and Tx share LD bit, so check TDES3.LD bit */
return java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 2
TX_NORMAL_DESC3_LD_POS,
;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static int =(- )
{
unsigned int max_q_count, q_count
unsigned int reg, regval;
unsigned int i;
/java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
for (i = 0; i
=readlXLGMAC_MTL_REG, i,);
regval = XLGMAC_SET_REG_BITS(regval, MTL_Q_RQOMR_EHFC_POS,
MTL_Q_RQOMR_EHFC_LEN,intxlgmac_enable_tx_flow_control xlgmac_pdata *data)
writel(regval, XLGMAC_MTL_REG(pdata, i, MTL_Q_RQOMR));
}
/* Clear MAC flow control */
max_q_count = java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 26
q_count = min_t(java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
reg = MAC_Q0TFCR;
(i = ;i< q_count;i+){
regval = readl(pdata->mac_regs + reg);
regval = XLGMAC_SET_REG_BITS(regval,
MAC_Q0TFCR_TFE_POS,
,
0);
writel( MTL_Q, 1);
reg += MAC_QTFCR_INC;
}
return 0;
}
static int xlgmac_enable_tx_flow_control(struct q_count = min_t(unsigned int, pdata->tx_q_count, max_q_count);
{
unsigned int max_q_count, q_count;
unsigned int reg, regval;
unsigned int i;
/* Set MTL flow control */
for ( regva =XLGMAC_SET_REG_BITS(regval,MAC_Q0TFCR_TFE_POS,
regval = readl(XLGMAC_MTL_REG(pdata, i, MTL_Q_RQOMR));
regval = XLGMAC_SET_REG_BITS(regval, MTL_Q_RQOMR_EHFC_POS,
MTL_Q_RQOMR_EHFC_LEN, 1);
, i, MTL_Q_RQOMR));
}
/* Set MAC flow control */ MAC_Q0TFCR_PT_LEN,0ffff
max_q_count = XLGMAC_MAX_FLOW_CONTROL_QUEUES;
q_count = min_t(nsigned int,pdata-tx_q_count,max_q_count);
reg = MAC_Q0TFCR;
for (i = 0; i <
regval = readl(pdata->mac_regs + reg);
/* Enable transmit flow control */
regval = XLGMAC_SET_REG_BITS(regval, java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 1
MAC_Q0TFCR_TFE_LEN,
/* Set pause time */
regval = java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
MAC_Q0TFCR_PT_LEN, 0xffff);
regval m )
reg + MAC_QTFCR_INC;
}
return 0;
}
static int java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 1
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
regval = readl(pdatajava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0
MAC_RFCR_RFE_LEN,
java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 44
return 0;
}
static int xlgmac_config_rx_flow_control)
{
u32 regval;
regval = java.lang.StringIndexOutOfBoundsException: Range [40, 32) out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MAC_RFCR_RFE_LEN, 1{
writel(regval, unsignedi
return 0;
}
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 68
{
(data>)
xlgmac_enable_tx_flow_control( ;
else
(pdata;
return 0;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static intxlgmac_config_rx_flow_control(struct xlgmac_pdata *pdata)
{
if (pdata->rx_pause)
xlgmac_enable_rx_flow_controlpdata);
else
xlgmac_disable_rx_flow_control(pdata);
return 0;
}
static int xlgmac_config_rx_coalesce(struct xlgmac_pdata void xlgmac_config_flow_control(struct xlgmac_pdata *pdata)
{
struct xlgmac_channel *channel;
unsigned int i;
u32 regval;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
nnel){
if (!channel->rx_ring)
break;
regval = ijava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
regval = XLGMAC_SET_REG_BITS(for (i = 0; i < pdata->rx_q_countjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
DMA_CH_RIWT_RWT_LEN,
pdata-rx_riwt)
writel(regval, MTL_Q_RQOMR_FEP_LENjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 34
}
return 0;
}
staticjava.lang.StringIndexOutOfBoundsException: Range [46, 39) out of bounds for length 67
{
xlgmac_config_tx_flow_control(pdata);
xlgmac_config_rx_flow_control(pdata);
}
static void regval = XLGMAC_SET_REG_BITS(regval, MTL_Q_RQOMR_FUP_POS,
{
unsigned int i;
u32 regval;
for (i = 0; i < pdata->rx_q_count; i++) {
regval ;
regval = java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [33, 29) out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}i ;i >; i+,channel {
}
static void xlgmac_config_rx_fup_enable(struct xlgmac_pdata *
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
nsignedi;
u32 regval;
for (i = 0,java.lang.StringIndexOutOfBoundsException: Range [39, 31) out of bounds for length 54
regval xlgmac_config_tso_mode *java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
regval = struct xlgmac_channel *channel;
MTL_Q_RQOMR_FUP_LEN, 1);
writel(regval regvaljava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static int xlgmac_config_tx_coalesce(struct java.lang.StringIndexOutOfBoundsException: Range [0, 56) out of bounds for length 0
{
0;
}
static void xlgmac_config_rx_buffer_size(struct xlgmac_pdata *pdata)
{
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
unsigned int i;
u32 regval;
channel = pdata->channel_head;
for (i xlgmac_channelchanneljava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
break;
regval (>java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
regval = XLGMAC_SET_REG_BITS( regval =readl(LGMAC_DMA_REGchannel,)
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
pdata->rx_buf_size);
writel(egval,XLGMAC_DMA_REG(hannel,DMA_CH_RCR));
}
}
static xlgmac_config_tso_modestruct xlgmac_pdata *pdata)
{
struct xlgmac_channel *channel;
unsignedint ijava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
u32 regval;
writel(,pdata->mac_regs MAC_RCR)
for (i = 0; i < pdata
java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 24
break java.lang.StringIndexOutOfBoundsException: Range [17, 13) out of bounds for length 23
if (pdata->hw_feat.tso) {
regval = java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
regval = XLGMAC_SET_REG_BITS(
DMA_CH_TCR_TSE_LEN, 1);
writel(regval, XLGMAC_DMA_REG(channel, DMA_CH_TCR));
}
}
}
static void xlgmac_config_sph_mode(struct * ( usec * ( system_clock_mhz / 10^6 ) /
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*;
unsigned int i;
u32 regval;
channel = pdata->channel_head;
for (i = 0; i < pdata->channel_count; i++, channel++) {
if (!channel->rx_ring)
break;
regval = readl(XLGMAC_DMA_REG(channel, DMA_CH_CRjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
regval = XLGMAC_SET_REG_BITS(regval, /* Convert the input watchdog timer value to the usec
DMA_CH_CR_SPH_LEN 1;
writel(regval, XLGMAC_DMA_REG(channel, DMA_CH_CR Calculate requiredvalueasjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
}
regval = riwt*256)/(rate 1000000;
regval = XLGMAC_SET_REG_BITS(regval, MAC_RCR_HDSMS_POS,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
XLGMAC_SPH_HDSMS_SIZE);
writel(regval, pdata->mac_regs + MAC_RCR);
}
static unsigned int xlgmac_usec_to_riwt(struct xlgmac_pdata *pdata,
unsigned intstatic intxlgmac_config_rx_threshold xlgmac_pdata *java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
{
unsigned long rate;
unsigned int ret;
rate = pdata->sysclk_rate;
/* Convert the input usec value to the watchdog timer value. Each =readl(LGMAC_MTL_REG(pdata,i ))
* writel(,XLGMAC_MTL_REG(pdata,i MTL_Q_RQOMR);
* Calculate the required value
* ( usec * ( system_clock_mhz / 10^6 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*/
=(usec*(ate/1000000) 256
return ret;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static unsigned int xlgmac_riwt_to_usec(struct xlgmac_pdata
unsigned )
{
unsigned long rate;
unsigned int ret;
rate = pdata->sysclk_rate;
/* Convert the input watchdog timer value to the usec value. Eachreadlpdata)
* watchdog timer value is equivalent MTL_TC_QWR_QW_LEN 1;
* Calculate the required value =(egval, ,
* ( riwt * java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 38
*/
riwt 256 /rate/1000000)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
return ret;
}
static int xlgmac_config_rx_threshold(struct xlgmac_pdata *pdata,
unsigned int val)
{
unsigned int i;
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 12
for (i = 0; i < pdata->rx_q_count; i++) {
regval = readl netif_dbgp ,-netdev
regval=(egvalMTL_Q_RQOMR_RTC_POS
regval=readlXLGMAC_MTL_REG ,
writel(regval, XLGMAC_MTL_REG(pdata, i, java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 26
}
return 0;
}
static void xlgmac_config_mtl_mode(struct xlgmac_pdata *pdata )java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
{
unsigned int i;
u32 regval;
/* Set Tx to weighted round robin scheduling algorithm */
TXqu TCun, queue,i;
regv readl(LGMAC_MTL_REG(data,queue,
MTL_OMR_ETSALG_LEN, MTL_ETSALG_WRR);
MTL_Q_TQOMR);
/* Set Tx traffic classes to use WRR algorithm with equal weights */
< pdata-hw_feat.c_cnt i+) {
regval = readl(XLGMAC_MTL_REG(pdata, i, MTL_TC_ETSCR));
regval =XLGMAC_SET_REG_BITS(regval, MTL_TC_ETSCR_TSA_POS,
MTL_TC_ETSCR_TSA_LEN, MTL_TSA_ETS);
writel(regval, XLGMAC_MTL_REG(pdata, i, MTL_TC_ETSCR));
regval =readl(XLGMAC_MTL_REG(pdata,i MTL_TC_QWR);
regval = XLGMAC_SET_REG_BITS MTL_Q_TQOMR));
MTL_TC_QWR_QW_LEN, 1);
writel(regval,(,i );
}
/* Set Rx to strict priority algorithm */
regval pdata>+)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
prio_queues unsigned, EEE_8021QAZ_MAX_TCS
pdata->rx_q_count
writel(mac_regs+MTL_OMR;
}
static void java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
{ i , = ;i ;
unsigned int java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 11
unsigned int qptc, ,,pdata>,
unsigned int reg, regval;
unsigned int mask;
unsigned int i, j }
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
Classes
*/
qptc = pdata->tx_q_count / pdata->hw_feat.tc_cnt;
qptc_extra = pdata->tx_q_count % pdata->hw_feat.tc_cnt;
for (i = 0, queue = 0; i < pdata->hw_feat.tc_cnt; i++) {
for (j = 0; j < qptc; j++) {
netif_dbg(pdata, drv, pdata->netdev,
"TXq%u mapped to TC%u\n", queue, i);
regval = readl(XLGMAC_MTL_REG(pdata, queue,
MTL_Q_TQOMR));
regval = XLGMAC_SET_REG_BITS(regval,
MTL_Q_TQOMR_Q2TCMAP_POS
MTL_Q_TQOMR_Q2TCMAP_LEN
i);
writel(regval, XLGMAC_MTL_REG(pdata, queue,
MTL_Q_TQOMR));
queue++;
}
if (i < qptc_extra) {
netif_dbg(pdata, drv, pdata- ( %)& (! )
"TXq%u mapped to TC%u\n", queue, i);
regval = readl(XLGMAC_MTL_REG(pdata, queue,
MTL_Q_TQOMR));
regval java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MTL_Q_TQOMR_Q2TCMAP_POS,
MTL_Q_TQOMR_Q2TCMAP_LEN,
i);
writel(regval, XLGMAC_MTL_REG(pdata, queue,
MTL_Q_TQOMR));
queue++;
}
}
}
prio_queues = min_t(unsigned int, IEEE_8021QAZ_MAX_TCS,
/* Configure one to one, MTL Rx queue to DMA Rx channel mapping
java.lang.StringIndexOutOfBoundsException: Range [12, 10) out of bounds for length 48
reg = MAC_RQC2R;
regval = 0;
for (i = 0, prio = 0; i < prio_queues;) {
mask = 0;
for (j = 0; j < ppq; j++) {
netif_dbg *
"PRIO%u mapped regval = readl(pdata->ac_regs +reg);
mask |= (1 << prio);
prio++;
}
i java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 22
f_dbgpdata,drv,pdata-netdev,
"PRIO%u mapped to RXq%u\n", prio, regval =(MTL_RQDCM2R_Q8MDMACH|MTL_RQDCM2R_Q9MDMACH |
mask |= (1 << prio);
prio++;
}
ask < (i+%MAC_RQC2_Q_PER_REG))< 3))java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
if ((i % MAC_RQC2_Q_PER_REG) && (java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
continue;
writel(regval, pdata->ac_regs + reg);
reg += MAC_RQC2_INC;
regval = 0;
}
/* Configure one to one, MTL Rx queue to DMA Rx channel mapping
* ie Q0 <--> CH0, Q1 <--> CH1 ... Q11 <--> CH11
*/
reg MTL_RQDCM0Rjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
regval = readl(pdata->mac_regs +int;
regval
MTL_RQDCM0R_Q2MDMACHMTL_RQDCM0R_Q3MDMACH;
writel(regval, pdata->mac_regs + reg);
reg += MTL_RQDCM_INC;
regval = readl(pdata->mac_regs + reg);
regval |= (MTL_RQDCM1R_Q4MDMACH | java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 42
MTL_RQDCM1R_Q6MDMACH | MTL_RQDCM1R_Q7MDMACH regval=XLGMAC_SET_REG_BITSregval,MTL_Q_TQOMR_TQS_POS,
writel(regval, pdata->mac_regs + reg);
(egval,XLGMAC_MTL_REG(pdata,i MTL_Q_TQOMR);
regval = readl}
regval |= (MTL_RQDCM2R_Q8MDMACH | MTL_RQDCM2R_Q9MDMACH |
MTL_RQDCM2R_Q10MDMACH | java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 38
writel(regval,pdata-mac_regs + reg)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static unsigned int xlgmac_calculate_per_queue_fifo(
unsigned int fifo_size,
unsigned int queue_count)
{
unsigned int q_fifo_size;
unsigned int p_fifo;
/* Calculate the configured fifo size */
q_fifo_size = 1 < (fifo_size + 7)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
/* The configured value may not be the actual amount of fifo RAM */
q_fifo_size = min_t(unsigned int, XLGMAC_MAX_FIFO, q_fifo_size);
regvalregval =XLGMAC_SET_REG_BITS(,MTL_Q_RQOMR_RQS_POS,
/* Each increment in the queue fifo size represents 256 bytes of
fifo,with 0 representing 256 bytes. Distribute the fifo equally
een queues
*/
p_fifo q_fifo_size 256java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
if (p_fifo)
p_fifo--;
return p_fifo;
}
static void xlgmac_config_tx_fifo_size(struct xlgmac_pdata *pdata)
{
unsigned int fifo_size;
unsigned int i;
u32 regval;
fifo_size =
/
pdata->tx_q_count);
for (i = 0; i < pdata->tx_q_count 2;
regval = readl( /* De-activate flow control when more than 6k left in fifo */
java.lang.StringIndexOutOfBoundsException: Range [58, 8) out of bounds for length 59
MTL_Q_TQOMR_TQS_LEN, fifo_size);
writel(regval XLGMAC_MTL_REGpdata, i,MTL_Q_TQOMR))
}
netif_info(pdata,java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
hardwared byte fifoper queuen,
pdata->tx_q_count, ((fifo_size + 1) * 256
}
static XLGMAC_MTL_REGjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 56
{
unsigned int fifo_size;
unsigned int i;
u32 regval;
fifo_size = xlgmac_calculate_per_queue_fifo(
pdata->hw_feat.rx_fifo_size,
pdata->rx_q_count);
for (i = 0; i < pdata->rx_q_count; i++) {
regval = readl(XLGMAC_MTL_REG(pdata, i, MTL_Q_RQOMR unsigned int val)
regval = XLGMAC_SET_REG_BITSunsigned int ;
MTL_Q_RQOMR_RQS_LEN, fifo_size);
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 56
}
regval=XLGMAC_SET_REG_BITSregval MTL_Q_RQOMR_RSF_POS
MTL_Q_RQOMR_RSF_LEN, val);
pdata->rx_q_count, ((fifo_size + 1) * 256 writelr XLGMAC_MTL_REGpdata , MTL_Q_RQOMR)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
}
static return 0;
{
unsigned int i;
u32 regval;
for (i unsigned int valjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
regval = readl(XLGMAC_MTL_REG(pdata, i, MTL_Q_RQFCR));
/* Activate flow control when less than 4k left in fifo */
regval = XLGMAC_SET_REG_BITS(regval, MTL_Q_RQFCR_RFA_POS,
MTL_Q_RQFCR_RFA_LEN, 2);
/* De-activate flow control when more than 6k left in fifo */
regval = XLGMAC_SET_REG_BITS(regval, MTL_Q_RQFCR_RFD_POS,
MTL_Q_RQFCR_RFD_LEN, 4);
writel(regval, XLGMAC_MTL_REG(pdata, i, MTL_Q_RQFCR));
}
}
static int xlgmac_config_tx_thresholdjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
unsigned int
{
unsigned int i;
u32 regval;
for (i = 0; i < pdata->tx_q_count; i++) {
regval = readl(XLGMAC_MTL_REG(pdata, i, MTL_Q_TQOMR));
regval = XLGMAC_SET_REG_BITS(regval, MTL_Q_TQOMR_TTC_POS,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
writel(regval, XLGMAC_MTL_REG (i = 0 i pdata-channel_count i+,channel+ java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
}
return 0regvalchannel)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static int xlgmac_config_rsf_mode(struct xlgmac_pdata *pdata,
unsigned int val)
{
unsigned int i return 0;
u32 regval;
for (i = 0; java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
regval = readl(XLGMAC_MTL_REG(pdata, i, MTL_Q_RQOMR));
regval = XLGMAC_SET_REG_BITS(regval, struct xlgmac_channel *channel;
MTL_Q_RQOMR_RSF_LEN, val);
writel(regval, XLGMAC_MTL_REG(pdata, i, MTL_Q_RQOMRregval;
}
return 0;
}
static int xlgmac_config_tsf_mode(struct xlgmac_pdata *pdata,
unsigned int val)
{
unsigned int i;
u32 regval;
forwritel(egval,XLGMAC_DMA_REG(,DMA_CH_CR);
regval = readl(XLGMAC_MTL_REG(pdata, i, MTL_Q_TQOMR));
regval = XLGMAC_SET_REG_BITS(regval, MTL_Q_TQOMR_TSF_POS,
MTL_Q_TQOMR_TSF_LEN return 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
writel(regval, XLGMAC_MTL_REG(pdata, i, static int xlgmac_get_tx_pbl_val(struct xlgmac_pdata *pdata)
}
return 0;
}
static int xlgmac_config_osp_mode(struct xlgmac_pdata *pdata)
{
struct xlgmac_channel *channel;
unsigned int i;
u32 regval;
channel = pdata->channel_head;
for (i
!-tjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
break;
regval = readl(XLGMAC_DMA_REG(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
XLGMAC_SET_REG_BITSregval,DMA_CH_TCR_OSP_POS
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
pdata->tx_osp_mode);
writel(regval, XLGMAC_DMA_REG(channel, DMA_CH_TCR));
}
return 0;
}
static(structxlgmac_pdata *pdata)
{
struct xlgmac_channel *channel;
unsigned int i;
u32 regval;
channel = pdata->channel_head;
for (i = 0; i < pdata->channel_count; i++, channel++) {
regval = readl(XLGMAC_DMA_REG(channel, java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 29
regval = XLGMAC_SET_REG_BITS(regval, java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 1
DMA_CH_CR_PBLX8_LEN,
pdata->pblx8);
writel(regval, XLGMAC_DMA_REG(channel, DMA_CH_CR));
}
return 0;
}
static int xlgmac_get_tx_pbl_val(struct xlgmac_pdata *pdata)
{
u32 regval;
regval = readl(XLGMAC_DMA_REG(pdata->channel_head, DMA_CH_TCR));
regval = XLGMAC_GET_REG_BITS(regval, DMA_CH_TCR_PBL_POS,
DMA_CH_TCR_PBL_LEN);
return regval;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static int xlgmac_config_tx_pbl_val(struct xlgmac_pdata *pdata)
{
struct xlgmac_channel *;
unsigned int i;
writel,( java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
channel = pdata->channel_head return 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
for (i = 0; i < pdata->channel_count; i++, channel++) {
if (!channel->tx_ringstatic u64 xlgmac_mmc_read( xlgmac_pdata pdata unsigned int)
break;
regval = readl(XLGMAC_DMA_REG(u64val;
regval = XLGMAC_SET_REG_BITS(regval, DMA_CH_TCR_PBL_POS,
DMA_CH_TCR_PBL_LEN,
pdata->tx_pbl);
writel(regval, XLGMAC_DMA_REG(channel /* These registers are always 64 bit */
}
return 0;
}
static int xlgmac_get_rx_pbl_val(struct xlgmac_pdata *pdata)
{
u32 regval;
regval :
regval = XLGMAC_GET_REG_BITS(regval, DMA_CH_RCR_PBL_POS,
DMA_CH_RCR_PBL_LEN);
return regval;
}
static int xlgmac_config_rx_pbl_val(struct
{
struct xlgmac_channel *channel;
unsigned int i;
u32 regval;
channel = pdata->channel_head;
for (i = 0; i < pdata->channel_count; i++, channel++java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (!channel->rx_ring)
break;
regval = readl(XLGMAC_DMA_REG struct xlgmac_stats stats=&pdata->tats;
regval = XLGMAC_SET_REG_BITS(regval, DMA_CH_RCR_PBL_POS,
DMA_CH_RCR_PBL_LEN if (LGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXOCTET,
writel( MMC_TISR_TXOCTETCOUNT_GB_LEN)
}
return 0;
}
(java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 75
{
bool read_hi;
u64 val;
switch
/* These registers are always 64 bit */
case MMC_TXOCTETCOUNT_GB_LO:
case MMC_TXOCTETCOUNT_G_LO:
case MMC_RXOCTETCOUNT_GB_LO:
case MMC_RXOCTETCOUNT_G_LO:
read_hi = true;
break;
default:
read_hi java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
val=(u64)readl(pdata-mac_regs+reg_lo;
if (read_hi)
+ reg_lo +4 < 32;
return java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
}
static structxlgmac_pdatajava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
{
unsigned readlpmac_regs )
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXOCTETCOUNT_GB_POS,
MMC_TISR_TXOCTETCOUNT_GB_LEN))
stats->txoctetcount_gb +=
xlgmac_mmc_read(pdata, MMC_TXOCTETCOUNT_GB_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXFRAMECOUNT_GB_POS,
MMC_TISR_TXFRAMECOUNT_GB_LEN))
xlgmac_mmc_read(pdata, java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 39
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXBROADCASTFRAMES_G_POS,
MMC_TISR_TXBROADCASTFRAMES_G_LEN))
>+
xlgmac_mmc_read )
if (XLGMAC_GET_REG_BITS(mmc_isr ( java.lang.StringIndexOutOfBoundsException: Range [53, 51) out of bounds for length 53
MMC_TISR_TXMULTICASTFRAMES_G_POS,
MMC_TISR_TXMULTICASTFRAMES_G_LEN))
stats->txmulticastframes_g +=
xlgmac_mmc_read(pdata, MMC_TXMULTICASTFRAMES_G_LO pdata java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 55
if MMC_TISR_TXBROADCASTFRAMES_GB_POS
MMC_TISR_TXBROADCASTFRAMES_GB_LEN)
MMC_TISR_TX64OCTETS_GB_LEN))
+=
pdata );
if (java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
)
MMC_TISR_TX65TO127OCTETS_GB_LEN))
stats->tx65to127octets_gb +=
xlgmac_mmc_read(pdata, java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 0
if (XLGMAC_GET_REG_BITS( MMC_TISR_TXOCTETCOUNT_G_LEN)
MMC_TISR_TX128TO255OCTETS_GB_POS,
MMC_TISR_TX128TO255OCTETS_GB_LEN))
> =
xlgmac_mmc_read(pdata, MMC_TX128TO255OCTETS_GB_LO);
if ((mmc_isr,
MMC_TISR_TX256TO511OCTETS_GB_POS stats-txframecount_g =
MMC_TISR_TX256TO511OCTETS_GB_LEN))
s_gb +java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
xlgmac_mmc_read(pdata, java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 33
if (XLGMAC_GET_REG_BITS(mmc_isr,
B_POS,
stats-txpauseframes +=
stats->tx512to1023octets_gb +=
xlgmac_mmc_read(,MMC_TX512TO1023OCTETS_GB_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
_POS,
MMC_TISR_TX1024TOMAXOCTETS_GB_LEN))
stats->tx1024tomaxoctets_gb +=
xlgmac_mmc_read(pdata, MMC_TX1024TOMAXOCTETS_GB_LO);
if(LGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXUNICASTFRAMES_GB_POS,
MMC_TISR_TXUNICASTFRAMES_GB_LEN))
stats->txunicastframes_gb +=
xlgmac_mmc_read(pdata, MMC_TXUNICASTFRAMES_GB_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXMULTICASTFRAMES_GB_POS,
MMC_TISR_TXMULTICASTFRAMES_GB_LEN))
stats->txmulticastframes_gb +=
CASTFRAMES_GB_LO;
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXBROADCASTFRAMES_GB_POS,
MMC_TISR_TXBROADCASTFRAMES_GB_LEN))
stats->txbroadcastframes_g + r
pdata)
if (XLGMAC_GET_REG_BITS( if (XLGMAC_GET_REG_BITS(mmc_isr
,
MMC_TISR_TXUNDERFLOWERROR_LENjava.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0
xlgmac_mmc_read(pdata, MMC_TXUNDERFLOWERROR_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXOCTETCOUNT_G_POS,
xlgmac_mmc_read(pdata, MMC_RXOCTETCOUNT_G_LO);
stats->txoctetcount_g +=
xlgmac_mmc_read(pdata, MMC_TXOCTETCOUNT_G_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXBROADCASTFRAMES_G_POS,
MMC_TISR_TXFRAMECOUNT_G_LEN)
stats->txframecount_g +=
xlgmac_mmc_read(pdata, MMC_TXFRAMECOUNT_G_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXPAUSEFRAMES_POS, if (LGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXPAUSEFRAMES_LEN))
stats->txpauseframes +=
xlgmac_mmc_read(pdata, MMC_TXPAUSEFRAMES_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_TISR_TXVLANFRAMES_G_POS,
MMC_TISR_TXVLANFRAMES_G_LEN))
stats->java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
xlgmac_mmc_read(pdata, MMC_TXVLANFRAMES_G_LO);
}
static void java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 22
{
unsigned int mmc_isr = readl(pdata->mac_regs + MMC_RISR);
struct xlgmac_stats *stats = &pdata->stats;
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXFRAMECOUNT_GB_POS,
MMC_RISR_RXFRAMECOUNT_GB_LEN))
stats->rxframecount_gb +=
xlgmac_mmc_read(pdata, MMC_RXFRAMECOUNT_GB_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
S,
MMC_RISR_RXOCTETCOUNT_GB_LEN))
>+=
xlgmac_mmc_read(pdata, xlgmac_mmc_read(pdata, MMC_RXJABBERERROR(data, java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXOCTETCOUNT_G_POS,
MMC_RISR_RXOCTETCOUNT_G_LEN))
stats-> stats-->rxundersize_g+=
xlgmac_mmc_read(pdata, MMC_RXOCTETCOUNT_G_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXBROADCASTFRAMES_G_POS,
MMC_RISR_RXBROADCASTFRAMES_G_LEN))
stats->rxbroadcastframes_g +=
xlgmac_mmc_read(pdata, MMC_RXBROADCASTFRAMES_G_LO);
if(XLGMAC_GET_REG_BITS(mc_isr,
xlgmac_mmc_read(pdata, MMC_RXOVERS);
MMC_RISR_RXMULTICASTFRAMES_G_LEN))
stats->rxmulticastframes_g +=
xlgmac_mmc_read(pdata, MMC_RXMULTICASTFRAMES_G_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXCRCERROR_POS
MMC_RISR_RXCRCERROR_LEN)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
stats-> MMC_RISR_RX65TO,
xlgmac_mmc_read(pdata, MMC_RXCRCERROR_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXRUNTERROR_POS,
MMC_RISR_RXRUNTERROR_LEN))
stats->rxrunterror +=
xlgmac_mmc_read(pdata, MMC_RXRUNTERROR);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXJABBERERROR_POS,
))
(,MMC_RXJABBERERROR
if (XLGMAC_GET_REG_BITS( MMC_RISR_RX256TO511OCTETS_GB)
MMC_RISR_RXUNDERSIZE_G_POS,
MMC_RISR_RXUNDERSIZE_G_LEN))
stats->rxundersize_g +=
xlgmac_mmc_read(pdata, MMC_RXUNDERSIZE_G);
if(XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXOVERSIZE_G_POS,
MMC_RISR_RXOVERSIZE_G_LEN))
stats->rxoversize_g + if (XLGMAC_GET_REG_BITS(mc_isr,
xlgmac_mmc_read(pdata, MMC_RXOVERSIZE_G);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RX64OCTETS_GB_POS,
MMC_RISR_RX64OCTETS_GB_LEN))
stats->rx64octets_gb +=
xlgmac_mmc_read(pdata, MMC_RX64OCTETS_GB_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RX65TO127OCTETS_GB_POS,
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 29
stats->rx65to127octets_gb +=
xlgmac_mmc_read(pdata, MMC_RX65TO127OCTETS_GB_LOX(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
if (XLGMAC_GET_REG_BITSjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 48
POS
MMC_RISR_RX128TO255OCTETS_GB_LEN)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
stats->rx128to255octets_gb +=
xlgmac_mmc_read(pdata, MMC_RX128TO255OCTETS_GB_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RX256TO511OCTETS_GB_POS,
LEN)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
stats->rx256to511octets_gb +=
xlgmac_mmc_read(pdata, MMC_RX256TO511OCTETS_GB_LO);
(mmc_isr,
MMC_RISR_RX512TO1023OCTETS_GB_LEN))
stats->rx512to1023octets_gb +=
xlgmac_mmc_read(pdata, MMC_RISR_RXFIFOOVERFLOW_POS,
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RX1024TOMAXOCTETS_GB_POS,
MMC_RISR_RX1024TOMAXOCTETS_GB_LEN))
stats->rx1024tomaxoctets_gb +=
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
if(mmc_isrjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
MMC_RISR_RXUNICASTFRAMES_G_POS,
MMC_RISR_RXUNICASTFRAMES_G_LEN))
stats->rxunicastframes_g
xlgmac_mmc_read(pdata,MMC_RXUNICASTFRAMES_G_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXLENGTHERROR_POS,
MMC_RISR_RXLENGTHERROR_LEN))
stats->rxlengtherror +=
xlgmac_mmc_read(data,MMC_RXLENGTHERROR_LO);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
MMC_RISR_RXOUTOFRANGETYPE_POS,
MMC_RISR_RXOUTOFRANGETYPE_LEN))
stats->rxoutofrangetype +=
xlgmac_mmc_read(pdata, MMC_RXOUTOFRANGETYPE_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXPAUSEFRAMES_POS,
))
stats->rxpauseframes +=
xlgmac_mmc_read(pdata, MMC_RXPAUSEFRAMES_LO);
if ( writel(regval,>ac_regs MMC_CR;
MMC_RISR_RXFIFOOVERFLOW_POS,
MMC_RISR_RXFIFOOVERFLOW_LEN))
stats->rxfifooverflow +=
xlgmac_mmc_read(,MMC_RXFIFOOVERFLOW_LO);
if (XLGMAC_GET_REG_BITS(mmc_isr,
>txframecount_gb
MMC_RISR_RXVLANFRAMES_GB_LEN))
stats->->txbroadcastframes_g
)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
if (XLGMAC_GET_REG_BITS(mmc_isr,
MMC_RISR_RXWATCHDOGERROR_POS,
MMC_RISR_RXWATCHDOGERROR_LEN))
stats->rxwatchdogerror +=
xlgmac_mmc_read(pdata, MMC_RXWATCHDOGERROR);
}
static void xlgmac_read_mmc_stats(struct xlgmac_pdata *pdata)
{
struct xlgmac_stats *stats = &pdata->stats;
u32 regval;
/* Freeze counters */
- ;
regval = XLGMAC_SET_REG_BITS(regval, MMC_CR_MCF_POS,
MMC_CR_MCF_LEN, 1);
writel(regval, pdata->mac_regs + MMC_CR);
stats->txoctetcount_gb +=
xlgmac_mmc_read(pdata, MMC_TXOCTETCOUNT_GB_LO);
stats->txframecount_gb +=
xlgmac_mmc_read(pdata, MMC_TXFRAMECOUNT_GB_LO);
stats->txbroadcastframes_g +=
xlgmac_mmc_read(pdata, MMC_TXBROADCASTFRAMES_G_LO) stats->xmulticastframes_gb =
stats->txmulticastframes_g +=
xlgmac_mmc_read(pdata, MMC_TXMULTICASTFRAMES_G_LO);
stats->tx64octets_gb +=
xlgmac_mmc_read(pdata, MMC_TX64OCTETS_GB_LO);
stats->tx65to127octets_gb +=
xlgmac_mmc_read(pdata, java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
stats->tx128to255octets_gb +=
xlgmac_mmc_read(pdata, MMC_TX128TO255OCTETS_GB_LO);
stats->tx256to511octets_gb +=
xlgmac_mmc_read(pdata, MMC_TX256TO511OCTETS_GB_LO);
stats->tx512to1023octets_gb +=
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
stats-tx1024tomaxoctets_gb +=
xlgmac_mmc_read(pdata, MMC_TX1024TOMAXOCTETS_GB_LO);
stats +=
xlgmac_mmc_read(;
stats->txmulticastframes_gb +=
xlgmac_mmc_read(pdata, MMC_TXMULTICASTFRAMES_GB_LO);
java.lang.StringIndexOutOfBoundsException: Range [25, 6) out of bounds for length 30
xlgmac_mmc_read(pdata, MMC_TXBROADCASTFRAMES_GB_LO);
+java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
xlgmac_mmc_read(pdata, MMC_TXUNDERFLOWERROR_LO);
stats->txoctetcount_g +=
xlgmac_mmc_read(pdata, MMC_TXOCTETCOUNT_G_LO);
stats->txframecount_g +=
xlgmac_mmc_read(pdata, MMC_TXFRAMECOUNT_G_LO);
stats->txpauseframes +=
xlgmac_mmc_read(pdata, MMC_TXPAUSEFRAMES_LO);
stats->txvlanframes_g +=
xlgmac_mmc_read(pdata, MMC_TXVLANFRAMES_G_LO);
stats->rxframecount_gb +=
xlgmac_mmc_read(pdata, MMC_RXFRAMECOUNT_GB_LO);
stats->xoctetcount_gb +=
xlgmac_mmc_read(pdata, MMC_RXOCTETCOUNT_GB_LO);
stats->java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
xlgmac_mmc_read(pdata, MMC_RXOCTETCOUNT_G_LO);
stats
xlgmac_mmc_read(pdata,java.lang.StringIndexOutOfBoundsException: Range [53, 51) out of bounds for length 53
stats->rxmulticastframes_g +=
xlgmac_mmc_read(pdata, MMC_RXMULTICASTFRAMES_G_LO);
stats->rxcrcerror +=
(pdata MMC_RXCRCERROR_LO);
stats->rxrunterror +=
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 30
=
xlgmac_mmc_readpdata java.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 44
stats->rxundersize_g +=
xlgmac_mmc_read(pdata, MMC_RXUNDERSIZE_G);
stats->rxoversize_g +=
xlgmac_mmc_read(pdata, MMC_RXOVERSIZE_G);
stats->rx64octets_gb +=
xlgmac_mmc_read( xlgmac_mmc_readpdata MMC_RXLENGTHERROR_LO
stats->rx65to127octets_gb +=
xlgmac_mmc_read(pdata, MMC_RX65TO127OCTETS_GB_LO);
stats->rx128to255octets_gb p )
xlgmac_mmc_read(pdata, MMC_RX128TO255OCTETS_GB_LO);
xlgmac_mmc_readpdata, MMC_RXFIFOOVERFLOW_LO);
xlgmac_mmc_read(pdata, MMC_RX256TO511OCTETS_GB_LO);
stats->x512to1023octets_gb +=
xlgmac_mmc_read(pdata, MMC_RX512TO1023OCTETS_GB_LO);
stats->rx1024tomaxoctets_gb +=
xlgmac_mmc_read(pdata, MMC_RX1024TOMAXOCTETS_GB_LO);
stats->rxunicastframes_g +=
xlgmac_mmc_read(pdata, MMC_RXUNICASTFRAMES_G_LO);
stats->rxlengtherror +=
xlgmac_mmc_read(pdata, MMC_RXLENGTHERROR_LO);
stats->rxoutofrangetype +=
xlgmac_mmc_read(data MMC_RXOUTOFRANGETYPE_LO);
stats->rxpauseframes +=
xlgmac_mmc_read(pdata, MMC_RXPAUSEFRAMES_LO);
stats->rxfifooverflow +=
xlgmac_mmc_read(pdata, MMC_RXFIFOOVERFLOW_LO);
stats->rxvlanframes_gb +=
xlgmac_mmc_read(pdata, MMC_RXVLANFRAMES_GB_LO);
stats->rxwatchdogerror +=
xlgmac_mmc_read( MMC_RXWATCHDOGERROR);
/* Un-freeze counters */
regval /* Reset the counters */
regval =XLGMAC_SET_REG_BITS(egval,MMC_CR_MCF_POS,
MMC_CR_MCF_LEN, 0);
(egval pdata>mac_regs+MMC_CR);
}
static void xlgmac_config_mmc(struct xlgmac_pdata *
{
u32 regval;
regval = readl(pdata->mac_regs + MMC_CR);
/* Set counters to reset on read */
regval = XLGMAC_SET_REG_BITS(regval, MMC_CR_ROR_POS,
MMC_CR_ROR_LEN, 1);
/* Reset the counters */
regval = XLGMAC_SET_REG_BITS(regval, MMC_CR_CR_POS,
MMC_CR_CR_LEN, 1);
writel(egval,pdata-mac_regs MMC_CR)
}
static int xlgmac_write_rss_reg(struct xlgmac_pdata *pdata, unsigned int type,
unsigned int index goto unlock
{
unsigned int writel(val, pdata +)
int ret = 0;
u32 ;
mutex_lock(&pdata->rss_mutex);
regval = XLGMAC_GET_REG_BITS(readl(pdata->mac_regs + MAC_RSSAR),
MAC_RSSAR_OB_POS, MAC_RSSAR_OB_LEN);
if (regval) {
ret =EBUSY;
goto unlock;
}
writel(val, pdata->mac_regs + MAC_RSSDR);
regval = readl MAC_RSSAR_CT_LEN, 0);
regval = XLGMAC_SET_REG_BITS(regval, MAC_RSSAR_RSSIA_POS,
MAC_RSSAR_RSSIA_LEN, index);
regval = XLGMAC_SET_REG_BITS(regval, MAC_RSSAR_ADDRT_POS,
MAC_RSSAR_ADDRT_LEN, type);
regval = XLGMAC_SET_REG_BITS(regval, MAC_RSSAR_CT_POS,
MAC_RSSAR_CT_LEN, 0);
regval = XLGMAC_SET_REG_BITS(regval, MAC_RSSAR_OB_POS,
MAC_RSSAR_OB_LEN, 1);
writel(regval, pdata->mac_regs + MAC_RSSAR);
wait = 1000;
while (wait--) {
regval = XLGMAC_GET_REG_BITS(readl(pdata->mac_regs + java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 28
MAC_RSSAR_OB_POS,
MAC_RSSAR_OB_LEN);
if (!java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2
goto unlock;
usleep_range(1000, 1500);
}
ret = -EBUSY;
unlock:
mutex_unlock(&pdata->rss_mutex);
return ret;
}
static int xlgmac_write_rss_hash_key(struct xlgmac_pdata *pdata)
{
unsigned int key_regs = sizeof(pdata->rss_key) / sizeof(u32)
unsigned int *key = (unsigned int *)&pdata->rss_key;
int ret;
while (key_regs--) {
ret = xlgmac_write_rss_reg(pdata, XLGMAC_RSS_HASH_KEY_TYPE,
key_regs, *+;
if (ret)
return ret;
}
return 0;
}
static int xlgmac_write_rss_lookup_table(struct xlgmac_pdata *pdata)
{
unsigned int i;
int ret;
for (i = 0; i < ARRAY_SIZE(pdata-> for ( 0 i <ARRAY_SIZE(pdata->rss_table); i++) {
ret(pdata,
XLGMAC_RSS_LOOKUP_TABLE_TYPE XLGMAC_RSS_LOOKUP_TABLE_TYPE, i,
pdata->rss_table[i]);
if (ret)
return ret;
}
return 0;
static int xlgmac_set_rss_hash_key(struct java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 0
{
memcpy({
return xlgmac_write_rss_hash_key(pdata);
}
static int xlgmac_set_rss_lookup_table(struct xlgmac_pdata *pdata, return xlgmac_write_rss_hash_key(pdata);
const u32}
{
unsigned int i;
java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 10
for (i = 0; i < ARRAY_SIZE(pdata->rss_table); i++) {
tval = table[i];
pdata->rss_table[i] = XLGMAC_SET_REG_BITS(
pdata->rss_table[i],
MAC_RSSDR_DMCH_POS,
MAC_RSSDR_DMCH_LEN,
tval);
}
return xlgmac_write_rss_lookup_tablepdata)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
}
static int xlgmac_enable_rss(struct xlgmac_pdata *pdata)
{
u32 regval;
int ret;
if (!pdata->hw_featint (struct *data
return -EOPNOTSUPP;
/* Program the hash key */
ret = xlgmac_write_rss_hash_key(pdata);
if (ret)
return ret;
/* Program the lookup table */
ret = xlgmac_write_rss_lookup_table(pdata);
if (ret)
returnret;
/* Set the RSS options */
writel(pdata->rss_options, pdata-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Enable RSS */
regval = readl(pdata->mac_regs + MAC_RSSCR);
regval = XLGMAC_SET_REG_BITS(regval, MAC_RSSCR_RSSE_POS,
MAC_RSSCR_RSSE_LEN, 1);
writel(regval, pdata->mac_regs + MAC_RSSCR);
return 0;
}
static int xlgmac_disable_rss(struct xlgmac_pdata *pdata)
{
u32 regval;
if.rss
return -writel(regval,pdata-mac_regs + MAC_RSSCR);
regval = readl(pdata->mac_regs + MAC_RSSCR);
regval = XLGMAC_SET_REG_BITS(regval, MAC_RSSCR_RSSE_POS,
MAC_RSSCR_RSSE_LEN, 0);
writel(regval, static int xlgmac_disable_rss(struct xlgmac_pdata *pdata)
return 0;
}
g_rss(struct xlgmac_pdata *pdata)
{
int ret;
if (!pdata->hw_feat.rss)
return;;
if (pdata->netdev->features regval XLGMAC_SET_REG_BITS(regval,MAC_RSSCR_RSSE_POS,
ret = xlgmac_enable_rss(pdata);
else
ret = xlgmac_disable_rss(pdata);
if (ret)
netdev_err(pdata->netdev,
"error configuring RSS, RSS disabled\n");
}
static void xlgmac_enable_dma_interrupts ret
{
unsigned int dma_ch_isr,dma_ch_ier;
struct xlgmac_channel *channel;
unsigned int i;
=pdata-java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
for (i else
/* Clear all the interrupts which are set */
dma_ch_isr = readl(XLGMAC_DMA_REG(channel, DMA_CH_SR (ret)
writel(dma_ch_isr,XLGMAC_DMA_REG(channel, DMA_CH_SR));
/* Clear all interrupt enable bits */ "rror configuring RSS, RSS disabled\n");
dma_ch_ier = 0;
/
* NIE - Normal Interrupt Summary Enable
Abnormal Interrupt Summary Enable
* FBEE - Fatal Bus Error Enable
*/
dma_ch_ier = XLGMAC_SET_REG_BITS(dma_ch_ier,
DMA_CH_IER_NIE_POS,
DMA_CH_IER_NIE_LEN, 1);
dma_ch_ier = XLGMAC_SET_REG_BITS(dma_ch_ier,
DMA_CH_IER_AIE_POS,
DMA_CH_IER_AIE_LEN, 1);
dma_ch_ier =XLGMAC_SET_REG_BITS(dma_ch_ier,
DMA_CH_IER_FBEE_POS,
DMA_CH_IER_FBEE_LEN, 1);
if (channel->tx_ring) {
/* Enable the following Tx interrupts
* TIE - Transmit Interrupt Enable (unless using
* per channel interrupts)
*/
if (!pdata->per_channel_irq dma_ch_ier = 0;
dma_ch_ier = XLGMAC_SET_REG_BITS(
dma_ch_ier,
DMA_CH_IER_TIE_POS,
DMA_CH_IER_TIE_LEN,
1);
}
if (channel->rx_ring) {
/* Enable following Rx interrupts
* RBUE - Receive Buffer Unavailable Enable
* RIE - Receive Interrupt Enable (unless using
* per channel interrupts)
*/
dma_ch_ier = XLGMAC_SET_REG_BITS(
dma_ch_ier,
,
DMA_CH_IER_RBUE_LEN,
1;
if (>per_channel_irq
dma_ch_ier = XLGMAC_SET_REG_BITS(
dma_ch_ier,
DMA_CH_IER_FBEE_LEN,1)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
DMA_CH_IER_RIE_LEN,
1);
}
writel(dma_ch_isr, XLGMAC_DMA_REG(channel, DMA_CH_IER));
}
}
static void xlgmac_enable_mtl_interrupts(struct xlgmac_pdata *pdata)
{
unsigned int q_count, i;
unsigned int mtl_q_isr;
q_count = max(pdata->hw_feat.tx_q_cnt, pdata->hw_feat.rx_q_cnt);
for (i = 0; i <
/* Clear all the interrupts which are set */
mtl_q_isr = readl(XLGMAC_MTL_REG(pdata, i, MTL_Q_ISR));
writel(mtl_q_isr, XLGMAC_MTL_REG(pdata, i, MTL_Q_ISR));
/* No MTL interrupts to be enabled */
writel(0, XLGMAC_MTL_REG(pdata, i, MTL_Q_IER));
}
}
static void xlgmac_enable_mac_interrupts(struct xlgmac_pdata *pdata)
{
unsigned int mac_ier = 0;
u32 regval;
/* Enable Timestamp interrupt */
mac_ier = XLGMAC_SET_REG_BITS(mac_ier, MAC_IER_TSIE_POS,
MAC_IER_TSIE_LEN, 1);
writel(mac_ier, pdata->mac_regs + MAC_IER);
/java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
regval readl(pdata-> + MMC_RIER);
regval dma_ch_ier,
MMC_RIER_ALL_INTERRUPTS_LEN, 0xffffffff);
writel(regval, pdata->mac_regs + MMC_RIER);
java.lang.StringIndexOutOfBoundsException: Range [15, 7) out of bounds for length 44 | | |