mirror of
https://github.com/a52xq-dev/kernel.git
synced 2026-10-18 21:58:11 +07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
This commit is contained in:
commit
3f64116a83
66 changed files with 594 additions and 290 deletions
5
CREDITS
5
CREDITS
|
|
@ -2478,12 +2478,11 @@ S: D-90453 Nuernberg
|
|||
S: Germany
|
||||
|
||||
N: Arnaldo Carvalho de Melo
|
||||
E: acme@ghostprotocols.net
|
||||
E: acme@kernel.org
|
||||
E: arnaldo.melo@gmail.com
|
||||
E: acme@redhat.com
|
||||
W: http://oops.ghostprotocols.net:81/blog/
|
||||
P: 1024D/9224DF01 D5DF E3BB E3C8 BCBB F8AD 841A B6AB 4681 9224 DF01
|
||||
D: IPX, LLC, DCCP, cyc2x, wl3501_cs, net/ hacks
|
||||
D: tools/, IPX, LLC, DCCP, cyc2x, wl3501_cs, net/ hacks
|
||||
S: Brazil
|
||||
|
||||
N: Karsten Merker
|
||||
|
|
|
|||
|
|
@ -211,7 +211,13 @@ Colorspace sRGB (V4L2_COLORSPACE_SRGB)
|
|||
The :ref:`srgb` standard defines the colorspace used by most webcams
|
||||
and computer graphics. The default transfer function is
|
||||
``V4L2_XFER_FUNC_SRGB``. The default Y'CbCr encoding is
|
||||
``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is full range.
|
||||
``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited range.
|
||||
|
||||
Note that the :ref:`sycc` standard specifies full range quantization,
|
||||
however all current capture hardware supported by the kernel convert
|
||||
R'G'B' to limited range Y'CbCr. So choosing full range as the default
|
||||
would break how applications interpret the quantization range.
|
||||
|
||||
The chromaticities of the primary colors and the white reference are:
|
||||
|
||||
|
||||
|
|
@ -276,7 +282,7 @@ the following ``V4L2_YCBCR_ENC_601`` encoding as defined by :ref:`sycc`:
|
|||
|
||||
Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
|
||||
[-0.5…0.5]. This transform is identical to one defined in SMPTE
|
||||
170M/BT.601. The Y'CbCr quantization is full range.
|
||||
170M/BT.601. The Y'CbCr quantization is limited range.
|
||||
|
||||
|
||||
.. _col-adobergb:
|
||||
|
|
@ -288,10 +294,15 @@ The :ref:`adobergb` standard defines the colorspace used by computer
|
|||
graphics that use the AdobeRGB colorspace. This is also known as the
|
||||
:ref:`oprgb` standard. The default transfer function is
|
||||
``V4L2_XFER_FUNC_ADOBERGB``. The default Y'CbCr encoding is
|
||||
``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is full
|
||||
range. The chromaticities of the primary colors and the white reference
|
||||
are:
|
||||
``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
|
||||
range.
|
||||
|
||||
Note that the :ref:`oprgb` standard specifies full range quantization,
|
||||
however all current capture hardware supported by the kernel convert
|
||||
R'G'B' to limited range Y'CbCr. So choosing full range as the default
|
||||
would break how applications interpret the quantization range.
|
||||
|
||||
The chromaticities of the primary colors and the white reference are:
|
||||
|
||||
|
||||
.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
|
||||
|
|
@ -344,7 +355,7 @@ the following ``V4L2_YCBCR_ENC_601`` encoding:
|
|||
|
||||
Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
|
||||
[-0.5…0.5]. This transform is identical to one defined in SMPTE
|
||||
170M/BT.601. The Y'CbCr quantization is full range.
|
||||
170M/BT.601. The Y'CbCr quantization is limited range.
|
||||
|
||||
|
||||
.. _col-bt2020:
|
||||
|
|
|
|||
15
MAINTAINERS
15
MAINTAINERS
|
|
@ -877,8 +877,8 @@ S: Odd fixes
|
|||
F: drivers/hwmon/applesmc.c
|
||||
|
||||
APPLETALK NETWORK LAYER
|
||||
M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
|
||||
S: Maintained
|
||||
L: netdev@vger.kernel.org
|
||||
S: Odd fixes
|
||||
F: drivers/net/appletalk/
|
||||
F: net/appletalk/
|
||||
|
||||
|
|
@ -6748,9 +6748,8 @@ S: Odd Fixes
|
|||
F: drivers/tty/ipwireless/
|
||||
|
||||
IPX NETWORK LAYER
|
||||
M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
S: Odd fixes
|
||||
F: include/net/ipx.h
|
||||
F: include/uapi/linux/ipx.h
|
||||
F: net/ipx/
|
||||
|
|
@ -7522,8 +7521,8 @@ S: Maintained
|
|||
F: drivers/misc/lkdtm*
|
||||
|
||||
LLC (802.2)
|
||||
M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
|
||||
S: Maintained
|
||||
L: netdev@vger.kernel.org
|
||||
S: Odd fixes
|
||||
F: include/linux/llc.h
|
||||
F: include/uapi/linux/llc.h
|
||||
F: include/net/llc*
|
||||
|
|
@ -13416,10 +13415,8 @@ S: Maintained
|
|||
F: drivers/input/misc/wistron_btns.c
|
||||
|
||||
WL3501 WIRELESS PCMCIA CARD DRIVER
|
||||
M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
W: http://oops.ghostprotocols.net:81/blog
|
||||
S: Maintained
|
||||
S: Odd fixes
|
||||
F: drivers/net/wireless/wl3501*
|
||||
|
||||
WOLFSON MICROELECTRONICS DRIVERS
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc7
|
||||
EXTRAVERSION = -rc8
|
||||
NAME = Fearless Coyote
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ struct cpuinfo_x86 {
|
|||
__u8 x86_phys_bits;
|
||||
/* CPUID returned core id bits: */
|
||||
__u8 x86_coreid_bits;
|
||||
__u8 cu_id;
|
||||
/* Max extended CPUID function supported: */
|
||||
__u32 extended_cpuid_level;
|
||||
/* Maximum supported CPUID level, -1=no CPUID: */
|
||||
|
|
|
|||
|
|
@ -309,8 +309,22 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
|
|||
|
||||
/* get information required for multi-node processors */
|
||||
if (boot_cpu_has(X86_FEATURE_TOPOEXT)) {
|
||||
u32 eax, ebx, ecx, edx;
|
||||
|
||||
node_id = cpuid_ecx(0x8000001e) & 7;
|
||||
cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
|
||||
|
||||
node_id = ecx & 0xff;
|
||||
smp_num_siblings = ((ebx >> 8) & 0xff) + 1;
|
||||
|
||||
if (c->x86 == 0x15)
|
||||
c->cu_id = ebx & 0xff;
|
||||
|
||||
if (c->x86 >= 0x17) {
|
||||
c->cpu_core_id = ebx & 0xff;
|
||||
|
||||
if (smp_num_siblings > 1)
|
||||
c->x86_max_cores /= smp_num_siblings;
|
||||
}
|
||||
|
||||
/*
|
||||
* We may have multiple LLCs if L3 caches exist, so check if we
|
||||
|
|
|
|||
|
|
@ -1015,6 +1015,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)
|
|||
c->x86_model_id[0] = '\0'; /* Unset */
|
||||
c->x86_max_cores = 1;
|
||||
c->x86_coreid_bits = 0;
|
||||
c->cu_id = 0xff;
|
||||
#ifdef CONFIG_X86_64
|
||||
c->x86_clflush_size = 64;
|
||||
c->x86_phys_bits = 36;
|
||||
|
|
|
|||
|
|
@ -433,9 +433,15 @@ static bool match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
|
|||
int cpu1 = c->cpu_index, cpu2 = o->cpu_index;
|
||||
|
||||
if (c->phys_proc_id == o->phys_proc_id &&
|
||||
per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2) &&
|
||||
c->cpu_core_id == o->cpu_core_id)
|
||||
return topology_sane(c, o, "smt");
|
||||
per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2)) {
|
||||
if (c->cpu_core_id == o->cpu_core_id)
|
||||
return topology_sane(c, o, "smt");
|
||||
|
||||
if ((c->cu_id != 0xff) &&
|
||||
(o->cu_id != 0xff) &&
|
||||
(c->cu_id == o->cu_id))
|
||||
return topology_sane(c, o, "smt");
|
||||
}
|
||||
|
||||
} else if (c->phys_proc_id == o->phys_proc_id &&
|
||||
c->cpu_core_id == o->cpu_core_id) {
|
||||
|
|
|
|||
|
|
@ -1356,6 +1356,9 @@ void __init tsc_init(void)
|
|||
(unsigned long)cpu_khz / 1000,
|
||||
(unsigned long)cpu_khz % 1000);
|
||||
|
||||
/* Sanitize TSC ADJUST before cyc2ns gets initialized */
|
||||
tsc_store_and_check_tsc_adjust(true);
|
||||
|
||||
/*
|
||||
* Secondary CPUs do not run through tsc_init(), so set up
|
||||
* all the scale factors for all CPUs, assuming the same
|
||||
|
|
@ -1386,8 +1389,6 @@ void __init tsc_init(void)
|
|||
|
||||
if (unsynchronized_tsc())
|
||||
mark_tsc_unstable("TSCs unsynchronized");
|
||||
else
|
||||
tsc_store_and_check_tsc_adjust(true);
|
||||
|
||||
check_system_tsc_reliable();
|
||||
|
||||
|
|
|
|||
|
|
@ -286,13 +286,6 @@ void check_tsc_sync_source(int cpu)
|
|||
if (unsynchronized_tsc())
|
||||
return;
|
||||
|
||||
if (tsc_clocksource_reliable) {
|
||||
if (cpu == (nr_cpu_ids-1) || system_state != SYSTEM_BOOTING)
|
||||
pr_info(
|
||||
"Skipped synchronization checks as TSC is reliable.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the maximum number of test runs to
|
||||
* 1 if the CPU does not provide the TSC_ADJUST MSR
|
||||
|
|
@ -380,14 +373,19 @@ void check_tsc_sync_target(void)
|
|||
int cpus = 2;
|
||||
|
||||
/* Also aborts if there is no TSC. */
|
||||
if (unsynchronized_tsc() || tsc_clocksource_reliable)
|
||||
if (unsynchronized_tsc())
|
||||
return;
|
||||
|
||||
/*
|
||||
* Store, verify and sanitize the TSC adjust register. If
|
||||
* successful skip the test.
|
||||
*
|
||||
* The test is also skipped when the TSC is marked reliable. This
|
||||
* is true for SoCs which have no fallback clocksource. On these
|
||||
* SoCs the TSC is frequency synchronized, but still the TSC ADJUST
|
||||
* register might have been wreckaged by the BIOS..
|
||||
*/
|
||||
if (tsc_store_and_check_tsc_adjust(false)) {
|
||||
if (tsc_store_and_check_tsc_adjust(false) || tsc_clocksource_reliable) {
|
||||
atomic_inc(&skip_test);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/debugfs.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/seq_file.h>
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
|
|
@ -406,6 +407,7 @@ static void ptdump_walk_pgd_level_core(struct seq_file *m, pgd_t *pgd,
|
|||
} else
|
||||
note_page(m, &st, __pgprot(0), 1);
|
||||
|
||||
cond_resched();
|
||||
start++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
#include <linux/bitops.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/irqchip.h>
|
||||
#include <linux/irqchip/chained_irq.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
|
|
@ -39,6 +39,7 @@ struct keystone_irq_device {
|
|||
struct irq_domain *irqd;
|
||||
struct regmap *devctrl_regs;
|
||||
u32 devctrl_offset;
|
||||
raw_spinlock_t wa_lock;
|
||||
};
|
||||
|
||||
static inline u32 keystone_irq_readl(struct keystone_irq_device *kirq)
|
||||
|
|
@ -83,17 +84,15 @@ static void keystone_irq_ack(struct irq_data *d)
|
|||
/* nothing to do here */
|
||||
}
|
||||
|
||||
static void keystone_irq_handler(struct irq_desc *desc)
|
||||
static irqreturn_t keystone_irq_handler(int irq, void *keystone_irq)
|
||||
{
|
||||
unsigned int irq = irq_desc_get_irq(desc);
|
||||
struct keystone_irq_device *kirq = irq_desc_get_handler_data(desc);
|
||||
struct keystone_irq_device *kirq = keystone_irq;
|
||||
unsigned long wa_lock_flags;
|
||||
unsigned long pending;
|
||||
int src, virq;
|
||||
|
||||
dev_dbg(kirq->dev, "start irq %d\n", irq);
|
||||
|
||||
chained_irq_enter(irq_desc_get_chip(desc), desc);
|
||||
|
||||
pending = keystone_irq_readl(kirq);
|
||||
keystone_irq_writel(kirq, pending);
|
||||
|
||||
|
|
@ -111,13 +110,15 @@ static void keystone_irq_handler(struct irq_desc *desc)
|
|||
if (!virq)
|
||||
dev_warn(kirq->dev, "spurious irq detected hwirq %d, virq %d\n",
|
||||
src, virq);
|
||||
raw_spin_lock_irqsave(&kirq->wa_lock, wa_lock_flags);
|
||||
generic_handle_irq(virq);
|
||||
raw_spin_unlock_irqrestore(&kirq->wa_lock,
|
||||
wa_lock_flags);
|
||||
}
|
||||
}
|
||||
|
||||
chained_irq_exit(irq_desc_get_chip(desc), desc);
|
||||
|
||||
dev_dbg(kirq->dev, "end irq %d\n", irq);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int keystone_irq_map(struct irq_domain *h, unsigned int virq,
|
||||
|
|
@ -182,9 +183,16 @@ static int keystone_irq_probe(struct platform_device *pdev)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
raw_spin_lock_init(&kirq->wa_lock);
|
||||
|
||||
platform_set_drvdata(pdev, kirq);
|
||||
|
||||
irq_set_chained_handler_and_data(kirq->irq, keystone_irq_handler, kirq);
|
||||
ret = request_irq(kirq->irq, keystone_irq_handler,
|
||||
0, dev_name(dev), kirq);
|
||||
if (ret) {
|
||||
irq_domain_remove(kirq->irqd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* clear all source bits */
|
||||
keystone_irq_writel(kirq, ~0x0);
|
||||
|
|
@ -199,6 +207,8 @@ static int keystone_irq_remove(struct platform_device *pdev)
|
|||
struct keystone_irq_device *kirq = platform_get_drvdata(pdev);
|
||||
int hwirq;
|
||||
|
||||
free_irq(kirq->irq, kirq);
|
||||
|
||||
for (hwirq = 0; hwirq < KEYSTONE_N_IRQ; hwirq++)
|
||||
irq_dispose_mapping(irq_find_mapping(kirq->irqd, hwirq));
|
||||
|
||||
|
|
|
|||
|
|
@ -131,12 +131,16 @@ static struct irq_chip mxs_icoll_chip = {
|
|||
.irq_ack = icoll_ack_irq,
|
||||
.irq_mask = icoll_mask_irq,
|
||||
.irq_unmask = icoll_unmask_irq,
|
||||
.flags = IRQCHIP_MASK_ON_SUSPEND |
|
||||
IRQCHIP_SKIP_SET_WAKE,
|
||||
};
|
||||
|
||||
static struct irq_chip asm9260_icoll_chip = {
|
||||
.irq_ack = icoll_ack_irq,
|
||||
.irq_mask = asm9260_mask_irq,
|
||||
.irq_unmask = asm9260_unmask_irq,
|
||||
.flags = IRQCHIP_MASK_ON_SUSPEND |
|
||||
IRQCHIP_SKIP_SET_WAKE,
|
||||
};
|
||||
|
||||
asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs)
|
||||
|
|
|
|||
|
|
@ -612,8 +612,7 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
|
|||
}
|
||||
memset(msg->msg + msg->len, 0, sizeof(msg->msg) - msg->len);
|
||||
if (msg->len == 1) {
|
||||
if (cec_msg_initiator(msg) != 0xf ||
|
||||
cec_msg_destination(msg) == 0xf) {
|
||||
if (cec_msg_destination(msg) == 0xf) {
|
||||
dprintk(1, "cec_transmit_msg: invalid poll message\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -638,7 +637,7 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
|
|||
dprintk(1, "cec_transmit_msg: destination is the adapter itself\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (cec_msg_initiator(msg) != 0xf &&
|
||||
if (msg->len > 1 && adap->is_configured &&
|
||||
!cec_has_log_addr(adap, cec_msg_initiator(msg))) {
|
||||
dprintk(1, "cec_transmit_msg: initiator has unknown logical address %d\n",
|
||||
cec_msg_initiator(msg));
|
||||
|
|
@ -1072,7 +1071,7 @@ static int cec_config_log_addr(struct cec_adapter *adap,
|
|||
|
||||
/* Send poll message */
|
||||
msg.len = 1;
|
||||
msg.msg[0] = 0xf0 | log_addr;
|
||||
msg.msg[0] = (log_addr << 4) | log_addr;
|
||||
err = cec_transmit_msg_fh(adap, &msg, NULL, true);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -218,22 +218,30 @@ static int smsusb_start_streaming(struct smsusb_device_t *dev)
|
|||
static int smsusb_sendrequest(void *context, void *buffer, size_t size)
|
||||
{
|
||||
struct smsusb_device_t *dev = (struct smsusb_device_t *) context;
|
||||
struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer;
|
||||
int dummy;
|
||||
struct sms_msg_hdr *phdr;
|
||||
int dummy, ret;
|
||||
|
||||
if (dev->state != SMSUSB_ACTIVE) {
|
||||
pr_debug("Device not active yet\n");
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
phdr = kmalloc(size, GFP_KERNEL);
|
||||
if (!phdr)
|
||||
return -ENOMEM;
|
||||
memcpy(phdr, buffer, size);
|
||||
|
||||
pr_debug("sending %s(%d) size: %d\n",
|
||||
smscore_translate_msg(phdr->msg_type), phdr->msg_type,
|
||||
phdr->msg_length);
|
||||
|
||||
smsendian_handle_tx_message((struct sms_msg_data *) phdr);
|
||||
smsendian_handle_message_header((struct sms_msg_hdr *)buffer);
|
||||
return usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2),
|
||||
buffer, size, &dummy, 1000);
|
||||
smsendian_handle_message_header((struct sms_msg_hdr *)phdr);
|
||||
ret = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2),
|
||||
phdr, size, &dummy, 1000);
|
||||
|
||||
kfree(phdr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *smsusb1_fw_lkup[] = {
|
||||
|
|
|
|||
|
|
@ -2910,6 +2910,7 @@ static void set_multicast_list(struct net_device *ndev)
|
|||
struct netdev_hw_addr *ha;
|
||||
unsigned int i, bit, data, crc, tmp;
|
||||
unsigned char hash;
|
||||
unsigned int hash_high = 0, hash_low = 0;
|
||||
|
||||
if (ndev->flags & IFF_PROMISC) {
|
||||
tmp = readl(fep->hwp + FEC_R_CNTRL);
|
||||
|
|
@ -2932,11 +2933,7 @@ static void set_multicast_list(struct net_device *ndev)
|
|||
return;
|
||||
}
|
||||
|
||||
/* Clear filter and add the addresses in hash register
|
||||
*/
|
||||
writel(0, fep->hwp + FEC_GRP_HASH_TABLE_HIGH);
|
||||
writel(0, fep->hwp + FEC_GRP_HASH_TABLE_LOW);
|
||||
|
||||
/* Add the addresses in hash register */
|
||||
netdev_for_each_mc_addr(ha, ndev) {
|
||||
/* calculate crc32 value of mac address */
|
||||
crc = 0xffffffff;
|
||||
|
|
@ -2954,16 +2951,14 @@ static void set_multicast_list(struct net_device *ndev)
|
|||
*/
|
||||
hash = (crc >> (32 - FEC_HASH_BITS)) & 0x3f;
|
||||
|
||||
if (hash > 31) {
|
||||
tmp = readl(fep->hwp + FEC_GRP_HASH_TABLE_HIGH);
|
||||
tmp |= 1 << (hash - 32);
|
||||
writel(tmp, fep->hwp + FEC_GRP_HASH_TABLE_HIGH);
|
||||
} else {
|
||||
tmp = readl(fep->hwp + FEC_GRP_HASH_TABLE_LOW);
|
||||
tmp |= 1 << hash;
|
||||
writel(tmp, fep->hwp + FEC_GRP_HASH_TABLE_LOW);
|
||||
}
|
||||
if (hash > 31)
|
||||
hash_high |= 1 << (hash - 32);
|
||||
else
|
||||
hash_low |= 1 << hash;
|
||||
}
|
||||
|
||||
writel(hash_high, fep->hwp + FEC_GRP_HASH_TABLE_HIGH);
|
||||
writel(hash_low, fep->hwp + FEC_GRP_HASH_TABLE_LOW);
|
||||
}
|
||||
|
||||
/* Set a MAC change in hardware. */
|
||||
|
|
|
|||
|
|
@ -189,9 +189,10 @@ static int alloc_long_term_buff(struct ibmvnic_adapter *adapter,
|
|||
}
|
||||
ltb->map_id = adapter->map_id;
|
||||
adapter->map_id++;
|
||||
|
||||
init_completion(&adapter->fw_done);
|
||||
send_request_map(adapter, ltb->addr,
|
||||
ltb->size, ltb->map_id);
|
||||
init_completion(&adapter->fw_done);
|
||||
wait_for_completion(&adapter->fw_done);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -505,7 +506,7 @@ rx_pool_alloc_failed:
|
|||
adapter->rx_pool = NULL;
|
||||
rx_pool_arr_alloc_failed:
|
||||
for (i = 0; i < adapter->req_rx_queues; i++)
|
||||
napi_enable(&adapter->napi[i]);
|
||||
napi_disable(&adapter->napi[i]);
|
||||
alloc_napi_failed:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
@ -1126,10 +1127,10 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev,
|
|||
crq.request_statistics.ioba = cpu_to_be32(adapter->stats_token);
|
||||
crq.request_statistics.len =
|
||||
cpu_to_be32(sizeof(struct ibmvnic_statistics));
|
||||
ibmvnic_send_crq(adapter, &crq);
|
||||
|
||||
/* Wait for data to be written */
|
||||
init_completion(&adapter->stats_done);
|
||||
ibmvnic_send_crq(adapter, &crq);
|
||||
wait_for_completion(&adapter->stats_done);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++)
|
||||
|
|
@ -1501,7 +1502,7 @@ static void init_sub_crqs(struct ibmvnic_adapter *adapter, int retry)
|
|||
adapter->req_rx_queues = adapter->opt_rx_comp_queues;
|
||||
adapter->req_rx_add_queues = adapter->max_rx_add_queues;
|
||||
|
||||
adapter->req_mtu = adapter->max_mtu;
|
||||
adapter->req_mtu = adapter->netdev->mtu + ETH_HLEN;
|
||||
}
|
||||
|
||||
total_queues = adapter->req_tx_queues + adapter->req_rx_queues;
|
||||
|
|
@ -2190,12 +2191,12 @@ static void handle_error_info_rsp(union ibmvnic_crq *crq,
|
|||
|
||||
if (!found) {
|
||||
dev_err(dev, "Couldn't find error id %x\n",
|
||||
crq->request_error_rsp.error_id);
|
||||
be32_to_cpu(crq->request_error_rsp.error_id));
|
||||
return;
|
||||
}
|
||||
|
||||
dev_err(dev, "Detailed info for error id %x:",
|
||||
crq->request_error_rsp.error_id);
|
||||
be32_to_cpu(crq->request_error_rsp.error_id));
|
||||
|
||||
for (i = 0; i < error_buff->len; i++) {
|
||||
pr_cont("%02x", (int)error_buff->buff[i]);
|
||||
|
|
@ -2274,8 +2275,8 @@ static void handle_error_indication(union ibmvnic_crq *crq,
|
|||
dev_err(dev, "Firmware reports %serror id %x, cause %d\n",
|
||||
crq->error_indication.
|
||||
flags & IBMVNIC_FATAL_ERROR ? "FATAL " : "",
|
||||
crq->error_indication.error_id,
|
||||
crq->error_indication.error_cause);
|
||||
be32_to_cpu(crq->error_indication.error_id),
|
||||
be16_to_cpu(crq->error_indication.error_cause));
|
||||
|
||||
error_buff = kmalloc(sizeof(*error_buff), GFP_ATOMIC);
|
||||
if (!error_buff)
|
||||
|
|
@ -2393,10 +2394,10 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq,
|
|||
case PARTIALSUCCESS:
|
||||
dev_info(dev, "req=%lld, rsp=%ld in %s queue, retrying.\n",
|
||||
*req_value,
|
||||
(long int)be32_to_cpu(crq->request_capability_rsp.
|
||||
(long int)be64_to_cpu(crq->request_capability_rsp.
|
||||
number), name);
|
||||
release_sub_crqs_no_irqs(adapter);
|
||||
*req_value = be32_to_cpu(crq->request_capability_rsp.number);
|
||||
*req_value = be64_to_cpu(crq->request_capability_rsp.number);
|
||||
init_sub_crqs(adapter, 1);
|
||||
return;
|
||||
default:
|
||||
|
|
@ -2631,12 +2632,12 @@ static void handle_query_cap_rsp(union ibmvnic_crq *crq,
|
|||
break;
|
||||
case MIN_MTU:
|
||||
adapter->min_mtu = be64_to_cpu(crq->query_capability.number);
|
||||
netdev->min_mtu = adapter->min_mtu;
|
||||
netdev->min_mtu = adapter->min_mtu - ETH_HLEN;
|
||||
netdev_dbg(netdev, "min_mtu = %lld\n", adapter->min_mtu);
|
||||
break;
|
||||
case MAX_MTU:
|
||||
adapter->max_mtu = be64_to_cpu(crq->query_capability.number);
|
||||
netdev->max_mtu = adapter->max_mtu;
|
||||
netdev->max_mtu = adapter->max_mtu - ETH_HLEN;
|
||||
netdev_dbg(netdev, "max_mtu = %lld\n", adapter->max_mtu);
|
||||
break;
|
||||
case MAX_MULTICAST_FILTERS:
|
||||
|
|
@ -2804,9 +2805,9 @@ static ssize_t trace_read(struct file *file, char __user *user_buf, size_t len,
|
|||
crq.collect_fw_trace.correlator = adapter->ras_comps[num].correlator;
|
||||
crq.collect_fw_trace.ioba = cpu_to_be32(trace_tok);
|
||||
crq.collect_fw_trace.len = adapter->ras_comps[num].trace_buff_size;
|
||||
ibmvnic_send_crq(adapter, &crq);
|
||||
|
||||
init_completion(&adapter->fw_done);
|
||||
ibmvnic_send_crq(adapter, &crq);
|
||||
wait_for_completion(&adapter->fw_done);
|
||||
|
||||
if (*ppos + len > be32_to_cpu(adapter->ras_comps[num].trace_buff_size))
|
||||
|
|
@ -3586,9 +3587,9 @@ static int ibmvnic_dump_show(struct seq_file *seq, void *v)
|
|||
memset(&crq, 0, sizeof(crq));
|
||||
crq.request_dump_size.first = IBMVNIC_CRQ_CMD;
|
||||
crq.request_dump_size.cmd = REQUEST_DUMP_SIZE;
|
||||
ibmvnic_send_crq(adapter, &crq);
|
||||
|
||||
init_completion(&adapter->fw_done);
|
||||
ibmvnic_send_crq(adapter, &crq);
|
||||
wait_for_completion(&adapter->fw_done);
|
||||
|
||||
seq_write(seq, adapter->dump_data, adapter->dump_data_size);
|
||||
|
|
@ -3634,8 +3635,8 @@ static void handle_crq_init_rsp(struct work_struct *work)
|
|||
}
|
||||
}
|
||||
|
||||
send_version_xchg(adapter);
|
||||
reinit_completion(&adapter->init_done);
|
||||
send_version_xchg(adapter);
|
||||
if (!wait_for_completion_timeout(&adapter->init_done, timeout)) {
|
||||
dev_err(dev, "Passive init timeout\n");
|
||||
goto task_failed;
|
||||
|
|
@ -3645,9 +3646,9 @@ static void handle_crq_init_rsp(struct work_struct *work)
|
|||
if (adapter->renegotiate) {
|
||||
adapter->renegotiate = false;
|
||||
release_sub_crqs_no_irqs(adapter);
|
||||
send_cap_queries(adapter);
|
||||
|
||||
reinit_completion(&adapter->init_done);
|
||||
send_cap_queries(adapter);
|
||||
if (!wait_for_completion_timeout(&adapter->init_done,
|
||||
timeout)) {
|
||||
dev_err(dev, "Passive init timeout\n");
|
||||
|
|
@ -3661,9 +3662,7 @@ static void handle_crq_init_rsp(struct work_struct *work)
|
|||
goto task_failed;
|
||||
|
||||
netdev->real_num_tx_queues = adapter->req_tx_queues;
|
||||
netdev->mtu = adapter->req_mtu;
|
||||
netdev->min_mtu = adapter->min_mtu;
|
||||
netdev->max_mtu = adapter->max_mtu;
|
||||
netdev->mtu = adapter->req_mtu - ETH_HLEN;
|
||||
|
||||
if (adapter->failover) {
|
||||
adapter->failover = false;
|
||||
|
|
@ -3777,9 +3776,9 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
|
|||
adapter->debugfs_dump = ent;
|
||||
}
|
||||
}
|
||||
ibmvnic_send_crq_init(adapter);
|
||||
|
||||
init_completion(&adapter->init_done);
|
||||
ibmvnic_send_crq_init(adapter);
|
||||
if (!wait_for_completion_timeout(&adapter->init_done, timeout))
|
||||
return 0;
|
||||
|
||||
|
|
@ -3787,9 +3786,9 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
|
|||
if (adapter->renegotiate) {
|
||||
adapter->renegotiate = false;
|
||||
release_sub_crqs_no_irqs(adapter);
|
||||
send_cap_queries(adapter);
|
||||
|
||||
reinit_completion(&adapter->init_done);
|
||||
send_cap_queries(adapter);
|
||||
if (!wait_for_completion_timeout(&adapter->init_done,
|
||||
timeout))
|
||||
return 0;
|
||||
|
|
@ -3803,7 +3802,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
|
|||
}
|
||||
|
||||
netdev->real_num_tx_queues = adapter->req_tx_queues;
|
||||
netdev->mtu = adapter->req_mtu;
|
||||
netdev->mtu = adapter->req_mtu - ETH_HLEN;
|
||||
|
||||
rc = register_netdev(netdev);
|
||||
if (rc) {
|
||||
|
|
|
|||
|
|
@ -1240,10 +1240,14 @@ int mlx5e_stats_flower(struct mlx5e_priv *priv,
|
|||
|
||||
mlx5_fc_query_cached(counter, &bytes, &packets, &lastuse);
|
||||
|
||||
preempt_disable();
|
||||
|
||||
tcf_exts_to_list(f->exts, &actions);
|
||||
list_for_each_entry(a, &actions, list)
|
||||
tcf_action_stats_update(a, bytes, packets, lastuse);
|
||||
|
||||
preempt_enable();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3207,7 +3207,7 @@ static int cpsw_resume(struct device *dev)
|
|||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
struct cpsw_common *cpsw = netdev_priv(ndev);
|
||||
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
|
||||
|
||||
/* Select default pin state */
|
||||
pinctrl_pm_select_default_state(dev);
|
||||
|
|
|
|||
|
|
@ -100,6 +100,14 @@
|
|||
/* BUFFER_ALIGN(adr) calculates the number of bytes to the next alignment. */
|
||||
#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32) adr)) % ALIGNMENT)
|
||||
|
||||
#ifdef __BIG_ENDIAN
|
||||
#define xemaclite_readl ioread32be
|
||||
#define xemaclite_writel iowrite32be
|
||||
#else
|
||||
#define xemaclite_readl ioread32
|
||||
#define xemaclite_writel iowrite32
|
||||
#endif
|
||||
|
||||
/**
|
||||
* struct net_local - Our private per device data
|
||||
* @ndev: instance of the network device
|
||||
|
|
@ -156,15 +164,15 @@ static void xemaclite_enable_interrupts(struct net_local *drvdata)
|
|||
u32 reg_data;
|
||||
|
||||
/* Enable the Tx interrupts for the first Buffer */
|
||||
reg_data = __raw_readl(drvdata->base_addr + XEL_TSR_OFFSET);
|
||||
__raw_writel(reg_data | XEL_TSR_XMIT_IE_MASK,
|
||||
drvdata->base_addr + XEL_TSR_OFFSET);
|
||||
reg_data = xemaclite_readl(drvdata->base_addr + XEL_TSR_OFFSET);
|
||||
xemaclite_writel(reg_data | XEL_TSR_XMIT_IE_MASK,
|
||||
drvdata->base_addr + XEL_TSR_OFFSET);
|
||||
|
||||
/* Enable the Rx interrupts for the first buffer */
|
||||
__raw_writel(XEL_RSR_RECV_IE_MASK, drvdata->base_addr + XEL_RSR_OFFSET);
|
||||
xemaclite_writel(XEL_RSR_RECV_IE_MASK, drvdata->base_addr + XEL_RSR_OFFSET);
|
||||
|
||||
/* Enable the Global Interrupt Enable */
|
||||
__raw_writel(XEL_GIER_GIE_MASK, drvdata->base_addr + XEL_GIER_OFFSET);
|
||||
xemaclite_writel(XEL_GIER_GIE_MASK, drvdata->base_addr + XEL_GIER_OFFSET);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -179,17 +187,17 @@ static void xemaclite_disable_interrupts(struct net_local *drvdata)
|
|||
u32 reg_data;
|
||||
|
||||
/* Disable the Global Interrupt Enable */
|
||||
__raw_writel(XEL_GIER_GIE_MASK, drvdata->base_addr + XEL_GIER_OFFSET);
|
||||
xemaclite_writel(XEL_GIER_GIE_MASK, drvdata->base_addr + XEL_GIER_OFFSET);
|
||||
|
||||
/* Disable the Tx interrupts for the first buffer */
|
||||
reg_data = __raw_readl(drvdata->base_addr + XEL_TSR_OFFSET);
|
||||
__raw_writel(reg_data & (~XEL_TSR_XMIT_IE_MASK),
|
||||
drvdata->base_addr + XEL_TSR_OFFSET);
|
||||
reg_data = xemaclite_readl(drvdata->base_addr + XEL_TSR_OFFSET);
|
||||
xemaclite_writel(reg_data & (~XEL_TSR_XMIT_IE_MASK),
|
||||
drvdata->base_addr + XEL_TSR_OFFSET);
|
||||
|
||||
/* Disable the Rx interrupts for the first buffer */
|
||||
reg_data = __raw_readl(drvdata->base_addr + XEL_RSR_OFFSET);
|
||||
__raw_writel(reg_data & (~XEL_RSR_RECV_IE_MASK),
|
||||
drvdata->base_addr + XEL_RSR_OFFSET);
|
||||
reg_data = xemaclite_readl(drvdata->base_addr + XEL_RSR_OFFSET);
|
||||
xemaclite_writel(reg_data & (~XEL_RSR_RECV_IE_MASK),
|
||||
drvdata->base_addr + XEL_RSR_OFFSET);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -321,7 +329,7 @@ static int xemaclite_send_data(struct net_local *drvdata, u8 *data,
|
|||
byte_count = ETH_FRAME_LEN;
|
||||
|
||||
/* Check if the expected buffer is available */
|
||||
reg_data = __raw_readl(addr + XEL_TSR_OFFSET);
|
||||
reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);
|
||||
if ((reg_data & (XEL_TSR_XMIT_BUSY_MASK |
|
||||
XEL_TSR_XMIT_ACTIVE_MASK)) == 0) {
|
||||
|
||||
|
|
@ -334,7 +342,7 @@ static int xemaclite_send_data(struct net_local *drvdata, u8 *data,
|
|||
|
||||
addr = (void __iomem __force *)((u32 __force)addr ^
|
||||
XEL_BUFFER_OFFSET);
|
||||
reg_data = __raw_readl(addr + XEL_TSR_OFFSET);
|
||||
reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);
|
||||
|
||||
if ((reg_data & (XEL_TSR_XMIT_BUSY_MASK |
|
||||
XEL_TSR_XMIT_ACTIVE_MASK)) != 0)
|
||||
|
|
@ -345,16 +353,16 @@ static int xemaclite_send_data(struct net_local *drvdata, u8 *data,
|
|||
/* Write the frame to the buffer */
|
||||
xemaclite_aligned_write(data, (u32 __force *) addr, byte_count);
|
||||
|
||||
__raw_writel((byte_count & XEL_TPLR_LENGTH_MASK),
|
||||
addr + XEL_TPLR_OFFSET);
|
||||
xemaclite_writel((byte_count & XEL_TPLR_LENGTH_MASK),
|
||||
addr + XEL_TPLR_OFFSET);
|
||||
|
||||
/* Update the Tx Status Register to indicate that there is a
|
||||
* frame to send. Set the XEL_TSR_XMIT_ACTIVE_MASK flag which
|
||||
* is used by the interrupt handler to check whether a frame
|
||||
* has been transmitted */
|
||||
reg_data = __raw_readl(addr + XEL_TSR_OFFSET);
|
||||
reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);
|
||||
reg_data |= (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_XMIT_ACTIVE_MASK);
|
||||
__raw_writel(reg_data, addr + XEL_TSR_OFFSET);
|
||||
xemaclite_writel(reg_data, addr + XEL_TSR_OFFSET);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -369,7 +377,7 @@ static int xemaclite_send_data(struct net_local *drvdata, u8 *data,
|
|||
*
|
||||
* Return: Total number of bytes received
|
||||
*/
|
||||
static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data)
|
||||
static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data, int maxlen)
|
||||
{
|
||||
void __iomem *addr;
|
||||
u16 length, proto_type;
|
||||
|
|
@ -379,7 +387,7 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data)
|
|||
addr = (drvdata->base_addr + drvdata->next_rx_buf_to_use);
|
||||
|
||||
/* Verify which buffer has valid data */
|
||||
reg_data = __raw_readl(addr + XEL_RSR_OFFSET);
|
||||
reg_data = xemaclite_readl(addr + XEL_RSR_OFFSET);
|
||||
|
||||
if ((reg_data & XEL_RSR_RECV_DONE_MASK) == XEL_RSR_RECV_DONE_MASK) {
|
||||
if (drvdata->rx_ping_pong != 0)
|
||||
|
|
@ -396,27 +404,28 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data)
|
|||
return 0; /* No data was available */
|
||||
|
||||
/* Verify that buffer has valid data */
|
||||
reg_data = __raw_readl(addr + XEL_RSR_OFFSET);
|
||||
reg_data = xemaclite_readl(addr + XEL_RSR_OFFSET);
|
||||
if ((reg_data & XEL_RSR_RECV_DONE_MASK) !=
|
||||
XEL_RSR_RECV_DONE_MASK)
|
||||
return 0; /* No data was available */
|
||||
}
|
||||
|
||||
/* Get the protocol type of the ethernet frame that arrived */
|
||||
proto_type = ((ntohl(__raw_readl(addr + XEL_HEADER_OFFSET +
|
||||
proto_type = ((ntohl(xemaclite_readl(addr + XEL_HEADER_OFFSET +
|
||||
XEL_RXBUFF_OFFSET)) >> XEL_HEADER_SHIFT) &
|
||||
XEL_RPLR_LENGTH_MASK);
|
||||
|
||||
/* Check if received ethernet frame is a raw ethernet frame
|
||||
* or an IP packet or an ARP packet */
|
||||
if (proto_type > (ETH_FRAME_LEN + ETH_FCS_LEN)) {
|
||||
if (proto_type > ETH_DATA_LEN) {
|
||||
|
||||
if (proto_type == ETH_P_IP) {
|
||||
length = ((ntohl(__raw_readl(addr +
|
||||
length = ((ntohl(xemaclite_readl(addr +
|
||||
XEL_HEADER_IP_LENGTH_OFFSET +
|
||||
XEL_RXBUFF_OFFSET)) >>
|
||||
XEL_HEADER_SHIFT) &
|
||||
XEL_RPLR_LENGTH_MASK);
|
||||
length = min_t(u16, length, ETH_DATA_LEN);
|
||||
length += ETH_HLEN + ETH_FCS_LEN;
|
||||
|
||||
} else if (proto_type == ETH_P_ARP)
|
||||
|
|
@ -429,14 +438,17 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data)
|
|||
/* Use the length in the frame, plus the header and trailer */
|
||||
length = proto_type + ETH_HLEN + ETH_FCS_LEN;
|
||||
|
||||
if (WARN_ON(length > maxlen))
|
||||
length = maxlen;
|
||||
|
||||
/* Read from the EmacLite device */
|
||||
xemaclite_aligned_read((u32 __force *) (addr + XEL_RXBUFF_OFFSET),
|
||||
data, length);
|
||||
|
||||
/* Acknowledge the frame */
|
||||
reg_data = __raw_readl(addr + XEL_RSR_OFFSET);
|
||||
reg_data = xemaclite_readl(addr + XEL_RSR_OFFSET);
|
||||
reg_data &= ~XEL_RSR_RECV_DONE_MASK;
|
||||
__raw_writel(reg_data, addr + XEL_RSR_OFFSET);
|
||||
xemaclite_writel(reg_data, addr + XEL_RSR_OFFSET);
|
||||
|
||||
return length;
|
||||
}
|
||||
|
|
@ -463,14 +475,14 @@ static void xemaclite_update_address(struct net_local *drvdata,
|
|||
|
||||
xemaclite_aligned_write(address_ptr, (u32 __force *) addr, ETH_ALEN);
|
||||
|
||||
__raw_writel(ETH_ALEN, addr + XEL_TPLR_OFFSET);
|
||||
xemaclite_writel(ETH_ALEN, addr + XEL_TPLR_OFFSET);
|
||||
|
||||
/* Update the MAC address in the EmacLite */
|
||||
reg_data = __raw_readl(addr + XEL_TSR_OFFSET);
|
||||
__raw_writel(reg_data | XEL_TSR_PROG_MAC_ADDR, addr + XEL_TSR_OFFSET);
|
||||
reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);
|
||||
xemaclite_writel(reg_data | XEL_TSR_PROG_MAC_ADDR, addr + XEL_TSR_OFFSET);
|
||||
|
||||
/* Wait for EmacLite to finish with the MAC address update */
|
||||
while ((__raw_readl(addr + XEL_TSR_OFFSET) &
|
||||
while ((xemaclite_readl(addr + XEL_TSR_OFFSET) &
|
||||
XEL_TSR_PROG_MAC_ADDR) != 0)
|
||||
;
|
||||
}
|
||||
|
|
@ -603,7 +615,7 @@ static void xemaclite_rx_handler(struct net_device *dev)
|
|||
|
||||
skb_reserve(skb, 2);
|
||||
|
||||
len = xemaclite_recv_data(lp, (u8 *) skb->data);
|
||||
len = xemaclite_recv_data(lp, (u8 *) skb->data, len);
|
||||
|
||||
if (!len) {
|
||||
dev->stats.rx_errors++;
|
||||
|
|
@ -640,32 +652,32 @@ static irqreturn_t xemaclite_interrupt(int irq, void *dev_id)
|
|||
u32 tx_status;
|
||||
|
||||
/* Check if there is Rx Data available */
|
||||
if ((__raw_readl(base_addr + XEL_RSR_OFFSET) &
|
||||
if ((xemaclite_readl(base_addr + XEL_RSR_OFFSET) &
|
||||
XEL_RSR_RECV_DONE_MASK) ||
|
||||
(__raw_readl(base_addr + XEL_BUFFER_OFFSET + XEL_RSR_OFFSET)
|
||||
(xemaclite_readl(base_addr + XEL_BUFFER_OFFSET + XEL_RSR_OFFSET)
|
||||
& XEL_RSR_RECV_DONE_MASK))
|
||||
|
||||
xemaclite_rx_handler(dev);
|
||||
|
||||
/* Check if the Transmission for the first buffer is completed */
|
||||
tx_status = __raw_readl(base_addr + XEL_TSR_OFFSET);
|
||||
tx_status = xemaclite_readl(base_addr + XEL_TSR_OFFSET);
|
||||
if (((tx_status & XEL_TSR_XMIT_BUSY_MASK) == 0) &&
|
||||
(tx_status & XEL_TSR_XMIT_ACTIVE_MASK) != 0) {
|
||||
|
||||
tx_status &= ~XEL_TSR_XMIT_ACTIVE_MASK;
|
||||
__raw_writel(tx_status, base_addr + XEL_TSR_OFFSET);
|
||||
xemaclite_writel(tx_status, base_addr + XEL_TSR_OFFSET);
|
||||
|
||||
tx_complete = true;
|
||||
}
|
||||
|
||||
/* Check if the Transmission for the second buffer is completed */
|
||||
tx_status = __raw_readl(base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET);
|
||||
tx_status = xemaclite_readl(base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET);
|
||||
if (((tx_status & XEL_TSR_XMIT_BUSY_MASK) == 0) &&
|
||||
(tx_status & XEL_TSR_XMIT_ACTIVE_MASK) != 0) {
|
||||
|
||||
tx_status &= ~XEL_TSR_XMIT_ACTIVE_MASK;
|
||||
__raw_writel(tx_status, base_addr + XEL_BUFFER_OFFSET +
|
||||
XEL_TSR_OFFSET);
|
||||
xemaclite_writel(tx_status, base_addr + XEL_BUFFER_OFFSET +
|
||||
XEL_TSR_OFFSET);
|
||||
|
||||
tx_complete = true;
|
||||
}
|
||||
|
|
@ -698,7 +710,7 @@ static int xemaclite_mdio_wait(struct net_local *lp)
|
|||
/* wait for the MDIO interface to not be busy or timeout
|
||||
after some time.
|
||||
*/
|
||||
while (__raw_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) &
|
||||
while (xemaclite_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) &
|
||||
XEL_MDIOCTRL_MDIOSTS_MASK) {
|
||||
if (time_before_eq(end, jiffies)) {
|
||||
WARN_ON(1);
|
||||
|
|
@ -734,17 +746,17 @@ static int xemaclite_mdio_read(struct mii_bus *bus, int phy_id, int reg)
|
|||
* MDIO Address register. Set the Status bit in the MDIO Control
|
||||
* register to start a MDIO read transaction.
|
||||
*/
|
||||
ctrl_reg = __raw_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET);
|
||||
__raw_writel(XEL_MDIOADDR_OP_MASK |
|
||||
((phy_id << XEL_MDIOADDR_PHYADR_SHIFT) | reg),
|
||||
lp->base_addr + XEL_MDIOADDR_OFFSET);
|
||||
__raw_writel(ctrl_reg | XEL_MDIOCTRL_MDIOSTS_MASK,
|
||||
lp->base_addr + XEL_MDIOCTRL_OFFSET);
|
||||
ctrl_reg = xemaclite_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET);
|
||||
xemaclite_writel(XEL_MDIOADDR_OP_MASK |
|
||||
((phy_id << XEL_MDIOADDR_PHYADR_SHIFT) | reg),
|
||||
lp->base_addr + XEL_MDIOADDR_OFFSET);
|
||||
xemaclite_writel(ctrl_reg | XEL_MDIOCTRL_MDIOSTS_MASK,
|
||||
lp->base_addr + XEL_MDIOCTRL_OFFSET);
|
||||
|
||||
if (xemaclite_mdio_wait(lp))
|
||||
return -ETIMEDOUT;
|
||||
|
||||
rc = __raw_readl(lp->base_addr + XEL_MDIORD_OFFSET);
|
||||
rc = xemaclite_readl(lp->base_addr + XEL_MDIORD_OFFSET);
|
||||
|
||||
dev_dbg(&lp->ndev->dev,
|
||||
"xemaclite_mdio_read(phy_id=%i, reg=%x) == %x\n",
|
||||
|
|
@ -781,13 +793,13 @@ static int xemaclite_mdio_write(struct mii_bus *bus, int phy_id, int reg,
|
|||
* Data register. Finally, set the Status bit in the MDIO Control
|
||||
* register to start a MDIO write transaction.
|
||||
*/
|
||||
ctrl_reg = __raw_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET);
|
||||
__raw_writel(~XEL_MDIOADDR_OP_MASK &
|
||||
((phy_id << XEL_MDIOADDR_PHYADR_SHIFT) | reg),
|
||||
lp->base_addr + XEL_MDIOADDR_OFFSET);
|
||||
__raw_writel(val, lp->base_addr + XEL_MDIOWR_OFFSET);
|
||||
__raw_writel(ctrl_reg | XEL_MDIOCTRL_MDIOSTS_MASK,
|
||||
lp->base_addr + XEL_MDIOCTRL_OFFSET);
|
||||
ctrl_reg = xemaclite_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET);
|
||||
xemaclite_writel(~XEL_MDIOADDR_OP_MASK &
|
||||
((phy_id << XEL_MDIOADDR_PHYADR_SHIFT) | reg),
|
||||
lp->base_addr + XEL_MDIOADDR_OFFSET);
|
||||
xemaclite_writel(val, lp->base_addr + XEL_MDIOWR_OFFSET);
|
||||
xemaclite_writel(ctrl_reg | XEL_MDIOCTRL_MDIOSTS_MASK,
|
||||
lp->base_addr + XEL_MDIOCTRL_OFFSET);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -834,8 +846,8 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
|
|||
/* Enable the MDIO bus by asserting the enable bit in MDIO Control
|
||||
* register.
|
||||
*/
|
||||
__raw_writel(XEL_MDIOCTRL_MDIOEN_MASK,
|
||||
lp->base_addr + XEL_MDIOCTRL_OFFSET);
|
||||
xemaclite_writel(XEL_MDIOCTRL_MDIOEN_MASK,
|
||||
lp->base_addr + XEL_MDIOCTRL_OFFSET);
|
||||
|
||||
bus = mdiobus_alloc();
|
||||
if (!bus) {
|
||||
|
|
@ -1126,8 +1138,8 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
|
|||
}
|
||||
|
||||
/* Clear the Tx CSR's in case this is a restart */
|
||||
__raw_writel(0, lp->base_addr + XEL_TSR_OFFSET);
|
||||
__raw_writel(0, lp->base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET);
|
||||
xemaclite_writel(0, lp->base_addr + XEL_TSR_OFFSET);
|
||||
xemaclite_writel(0, lp->base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET);
|
||||
|
||||
/* Set the MAC address in the EmacLite device */
|
||||
xemaclite_update_address(lp, ndev->dev_addr);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue