mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-08-22 00:42:01 +02:00

Core & protocols ---------------- - Analyze and reorganize core networking structs (socks, netdev, netns, mibs) to optimize cacheline consumption and set up build time warnings to safeguard against future header changes. This improves TCP performances with many concurrent connections up to 40%. - Add page-pool netlink-based introspection, exposing the memory usage and recycling stats. This helps indentify bad PP users and possible leaks. - Refine TCP/DCCP source port selection to no longer favor even source port at connect() time when IP_LOCAL_PORT_RANGE is set. This lowers the time taken by connect() for hosts having many active connections to the same destination. - Refactor the TCP bind conflict code, shrinking related socket structs. - Refactor TCP SYN-Cookie handling, as a preparation step to allow arbitrary SYN-Cookie processing via eBPF. - Tune optmem_max for 0-copy usage, increasing the default value to 128KB and namespecifying it. - Allow coalescing for cloned skbs coming from page pools, improving RX performances with some common configurations. - Reduce extension header parsing overhead at GRO time. - Add bridge MDB bulk deletion support, allowing user-space to request the deletion of matching entries. - Reorder nftables struct members, to keep data accessed by the datapath first. - Introduce TC block ports tracking and use. This allows supporting multicast-like behavior at the TC layer. - Remove UAPI support for retired TC qdiscs (dsmark, CBQ and ATM) and classifiers (RSVP and tcindex). - More data-race annotations. - Extend the diag interface to dump TCP bound-only sockets. - Conditional notification of events for TC qdisc class and actions. - Support for WPAN dynamic associations with nearby devices, to form a sub-network using a specific PAN ID. - Implement SMCv2.1 virtual ISM device support. - Add support for Batman-avd mulicast packet type. BPF --- - Tons of verifier improvements: - BPF register bounds logic and range support along with a large test suite - log improvements - complete precision tracking support for register spills - track aligned STACK_ZERO cases as imprecise spilled registers. It improves the verifier "instructions processed" metric from single digit to 50-60% for some programs - support for user's global BPF subprogram arguments with few commonly requested annotations for a better developer experience - support tracking of BPF_JNE which helps cases when the compiler transforms (unsigned) "a > 0" into "if a == 0 goto xxx" and the like - several fixes - Add initial TX metadata implementation for AF_XDP with support in mlx5 and stmmac drivers. Two types of offloads are supported right now, that is, TX timestamp and TX checksum offload. - Fix kCFI bugs in BPF all forms of indirect calls from BPF into kernel and from kernel into BPF work with CFI enabled. This allows BPF to work with CONFIG_FINEIBT=y. - Change BPF verifier logic to validate global subprograms lazily instead of unconditionally before the main program, so they can be guarded using BPF CO-RE techniques. - Support uid/gid options when mounting bpffs. - Add a new kfunc which acquires the associated cgroup of a task within a specific cgroup v1 hierarchy where the latter is identified by its id. - Extend verifier to allow bpf_refcount_acquire() of a map value field obtained via direct load which is a use-case needed in sched_ext. - Add BPF link_info support for uprobe multi link along with bpftool integration for the latter. - Support for VLAN tag in XDP hints. - Remove deprecated bpfilter kernel leftovers given the project is developed in user-space (https://github.com/facebook/bpfilter). Misc ---- - Support for parellel TC self-tests execution. - Increase MPTCP self-tests coverage. - Updated the bridge documentation, including several so-far undocumented features. - Convert all the net self-tests to run in unique netns, to avoid random failures due to conflict and allow concurrent runs. - Add TCP-AO self-tests. - Add kunit tests for both cfg80211 and mac80211. - Autogenerate Netlink families documentation from YAML spec. - Add yml-gen support for fixed headers and recursive nests, the tool can now generate user-space code for all genetlink families for which we have specs. - A bunch of additional module descriptions fixes. - Catch incorrect freeing of pages belonging to a page pool. Driver API ---------- - Rust abstractions for network PHY drivers; do not cover yet the full C API, but already allow implementing functional PHY drivers in rust. - Introduce queue and NAPI support in the netdev Netlink interface, allowing complete access to the device <> NAPIs <> queues relationship. - Introduce notifications filtering for devlink to allow control application scale to thousands of instances. - Improve PHY validation, requesting rate matching information for each ethtool link mode supported by both the PHY and host. - Add support for ethtool symmetric-xor RSS hash. - ACPI based Wifi band RFI (WBRF) mitigation feature for the AMD platform. - Expose pin fractional frequency offset value over new DPLL generic netlink attribute. - Convert older drivers to platform remove callback returning void. - Add support for PHY package MMD read/write. New hardware / drivers ---------------------- - Ethernet: - Octeon CN10K devices - Broadcom 5760X P7 - Qualcomm SM8550 SoC - Texas Instrument DP83TG720S PHY - Bluetooth: - IMC Networks Bluetooth radio Removed ------- - WiFi: - libertas 16-bit PCMCIA support - Atmel at76c50x drivers - HostAP ISA/PCMCIA style 802.11b driver - zd1201 802.11b USB dongles - Orinoco ISA/PCMCIA 802.11b driver - Aviator/Raytheon driver - Planet WL3501 driver - RNDIS USB 802.11b driver Drivers ------- - Ethernet high-speed NICs: - Intel (100G, ice, idpf): - allow one by one port representors creation and removal - add temperature and clock information reporting - add get/set for ethtool's header split ringparam - add again FW logging - adds support switchdev hardware packet mirroring - iavf: implement symmetric-xor RSS hash - igc: add support for concurrent physical and free-running timers - i40e: increase the allowable descriptors - nVidia/Mellanox: - Preparation for Socket-Direct multi-dev netdev. That will allow in future releases combining multiple PFs devices attached to different NUMA nodes under the same netdev - Broadcom (bnxt): - TX completion handling improvements - add basic ntuple filter support - reduce MSIX vectors usage for MQPRIO offload - add VXLAN support, USO offload and TX coalesce completion for P7 - Marvell Octeon EP: - xmit-more support - add PF-VF mailbox support and use it for FW notifications for VFs - Wangxun (ngbe/txgbe): - implement ethtool functions to operate pause param, ring param, coalesce channel number and msglevel - Netronome/Corigine (nfp): - add flow-steering support - support UDP segmentation offload - Ethernet NICs embedded, slower, virtual: - Xilinx AXI: remove duplicate DMA code adopting the dma engine driver - stmmac: add support for HW-accelerated VLAN stripping - TI AM654x sw: add mqprio, frame preemption & coalescing - gve: add support for non-4k page sizes. - virtio-net: support dynamic coalescing moderation - nVidia/Mellanox Ethernet datacenter switches: - allow firmware upgrade without a reboot - more flexible support for bridge flooding via the compressed FID flooding mode - Ethernet embedded switches: - Microchip: - fine-tune flow control and speed configurations in KSZ8xxx - KSZ88X3: enable setting rmii reference - Renesas: - add jumbo frames support - Marvell: - 88E6xxx: add "eth-mac" and "rmon" stats support - Ethernet PHYs: - aquantia: add firmware load support - at803x: refactor the driver to simplify adding support for more chip variants - NXP C45 TJA11xx: Add MACsec offload support - Wifi: - MediaTek (mt76): - NVMEM EEPROM improvements - mt7996 Extremely High Throughput (EHT) improvements - mt7996 Wireless Ethernet Dispatcher (WED) support - mt7996 36-bit DMA support - Qualcomm (ath12k): - support for a single MSI vector - WCN7850: support AP mode - Intel (iwlwifi): - new debugfs file fw_dbg_clear - allow concurrent P2P operation on DFS channels - Bluetooth: - QCA2066: support HFP offload - ISO: more broadcast-related improvements - NXP: better recovery in case receiver/transmitter get out of sync Signed-off-by: Paolo Abeni <pabeni@redhat.com> -----BEGIN PGP SIGNATURE----- iQJGBAABCAAwFiEEg1AjqC77wbdLX2LbKSR5jcyPE6QFAmWdamsSHHBhYmVuaUBy ZWRoYXQuY29tAAoJECkkeY3MjxOkGC4P/2xjLzdw22ckSssuE9ORbGko9SNjnqHk PQh1E+26BHiCg5KB8VvzMsL78E79MRNXEattSW+1g7dhCvln3oi+Vd0WkdRkgt35 98Iv18zLbbwFAJeyKvmLAPAkQkMLtVj19QILBBRrugF+egEZgVSE3JBcTAiKv2ZQ HzkabA171Ri6LpCcEEtY5XuaKvimGnGzF8YMFf8rX0wtqd2p5kbY9aMe47WAGxvU Vf9548XvH+A5yVH2/4/gujtUOpA/RHuhuCMb+oo0cZ+VCC1x9MGzoXzj6r87OTkf k2W1whNzcGoin92f+9Lk1JYMuiGKBH4QVaDdNXJnYFSJWPTE7RvRsPzYTSD4/GzK yEZbzSJXpy/2vDQm16NoAxl7evRs8Sorzkw4LQRviZHI/5SAkK2ZQiCK5CO8QSYy C1LELcV5kn6Foe24xWnrWLjAGug9oJnYoGPMU5gvPmFJMvUMXqm5rmbBgUWL5Rxw q1M6gVzabCyWUy6z2G2vaqW2ZntNVvCkdsLtIX0XZkcTzNoP0MA+TuhyGz4wbiuo PeyQp/mbGnDgCYggqKIA0YWrTVxkhFrKN520cbO8qXBQytV9oFbM/0/+C0/r/5WX pL1JVzLrh6l5ME7EIQfha8UOF9j8q4ueSwb40P3AR2NaZiDABM0zfUZ6+sx+91WF ucqPEcZB5cRE =1bW6 -----END PGP SIGNATURE----- Merge tag 'net-next-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next Pull networking updates from Paolo Abeni: "The most interesting thing is probably the networking structs reorganization and a significant amount of changes is around self-tests. Core & protocols: - Analyze and reorganize core networking structs (socks, netdev, netns, mibs) to optimize cacheline consumption and set up build time warnings to safeguard against future header changes This improves TCP performances with many concurrent connections up to 40% - Add page-pool netlink-based introspection, exposing the memory usage and recycling stats. This helps indentify bad PP users and possible leaks - Refine TCP/DCCP source port selection to no longer favor even source port at connect() time when IP_LOCAL_PORT_RANGE is set. This lowers the time taken by connect() for hosts having many active connections to the same destination - Refactor the TCP bind conflict code, shrinking related socket structs - Refactor TCP SYN-Cookie handling, as a preparation step to allow arbitrary SYN-Cookie processing via eBPF - Tune optmem_max for 0-copy usage, increasing the default value to 128KB and namespecifying it - Allow coalescing for cloned skbs coming from page pools, improving RX performances with some common configurations - Reduce extension header parsing overhead at GRO time - Add bridge MDB bulk deletion support, allowing user-space to request the deletion of matching entries - Reorder nftables struct members, to keep data accessed by the datapath first - Introduce TC block ports tracking and use. This allows supporting multicast-like behavior at the TC layer - Remove UAPI support for retired TC qdiscs (dsmark, CBQ and ATM) and classifiers (RSVP and tcindex) - More data-race annotations - Extend the diag interface to dump TCP bound-only sockets - Conditional notification of events for TC qdisc class and actions - Support for WPAN dynamic associations with nearby devices, to form a sub-network using a specific PAN ID - Implement SMCv2.1 virtual ISM device support - Add support for Batman-avd mulicast packet type BPF: - Tons of verifier improvements: - BPF register bounds logic and range support along with a large test suite - log improvements - complete precision tracking support for register spills - track aligned STACK_ZERO cases as imprecise spilled registers. This improves the verifier "instructions processed" metric from single digit to 50-60% for some programs - support for user's global BPF subprogram arguments with few commonly requested annotations for a better developer experience - support tracking of BPF_JNE which helps cases when the compiler transforms (unsigned) "a > 0" into "if a == 0 goto xxx" and the like - several fixes - Add initial TX metadata implementation for AF_XDP with support in mlx5 and stmmac drivers. Two types of offloads are supported right now, that is, TX timestamp and TX checksum offload - Fix kCFI bugs in BPF all forms of indirect calls from BPF into kernel and from kernel into BPF work with CFI enabled. This allows BPF to work with CONFIG_FINEIBT=y - Change BPF verifier logic to validate global subprograms lazily instead of unconditionally before the main program, so they can be guarded using BPF CO-RE techniques - Support uid/gid options when mounting bpffs - Add a new kfunc which acquires the associated cgroup of a task within a specific cgroup v1 hierarchy where the latter is identified by its id - Extend verifier to allow bpf_refcount_acquire() of a map value field obtained via direct load which is a use-case needed in sched_ext - Add BPF link_info support for uprobe multi link along with bpftool integration for the latter - Support for VLAN tag in XDP hints - Remove deprecated bpfilter kernel leftovers given the project is developed in user-space (https://github.com/facebook/bpfilter) Misc: - Support for parellel TC self-tests execution - Increase MPTCP self-tests coverage - Updated the bridge documentation, including several so-far undocumented features - Convert all the net self-tests to run in unique netns, to avoid random failures due to conflict and allow concurrent runs - Add TCP-AO self-tests - Add kunit tests for both cfg80211 and mac80211 - Autogenerate Netlink families documentation from YAML spec - Add yml-gen support for fixed headers and recursive nests, the tool can now generate user-space code for all genetlink families for which we have specs - A bunch of additional module descriptions fixes - Catch incorrect freeing of pages belonging to a page pool Driver API: - Rust abstractions for network PHY drivers; do not cover yet the full C API, but already allow implementing functional PHY drivers in rust - Introduce queue and NAPI support in the netdev Netlink interface, allowing complete access to the device <> NAPIs <> queues relationship - Introduce notifications filtering for devlink to allow control application scale to thousands of instances - Improve PHY validation, requesting rate matching information for each ethtool link mode supported by both the PHY and host - Add support for ethtool symmetric-xor RSS hash - ACPI based Wifi band RFI (WBRF) mitigation feature for the AMD platform - Expose pin fractional frequency offset value over new DPLL generic netlink attribute - Convert older drivers to platform remove callback returning void - Add support for PHY package MMD read/write New hardware / drivers: - Ethernet: - Octeon CN10K devices - Broadcom 5760X P7 - Qualcomm SM8550 SoC - Texas Instrument DP83TG720S PHY - Bluetooth: - IMC Networks Bluetooth radio Removed: - WiFi: - libertas 16-bit PCMCIA support - Atmel at76c50x drivers - HostAP ISA/PCMCIA style 802.11b driver - zd1201 802.11b USB dongles - Orinoco ISA/PCMCIA 802.11b driver - Aviator/Raytheon driver - Planet WL3501 driver - RNDIS USB 802.11b driver Driver updates: - Ethernet high-speed NICs: - Intel (100G, ice, idpf): - allow one by one port representors creation and removal - add temperature and clock information reporting - add get/set for ethtool's header split ringparam - add again FW logging - adds support switchdev hardware packet mirroring - iavf: implement symmetric-xor RSS hash - igc: add support for concurrent physical and free-running timers - i40e: increase the allowable descriptors - nVidia/Mellanox: - Preparation for Socket-Direct multi-dev netdev. That will allow in future releases combining multiple PFs devices attached to different NUMA nodes under the same netdev - Broadcom (bnxt): - TX completion handling improvements - add basic ntuple filter support - reduce MSIX vectors usage for MQPRIO offload - add VXLAN support, USO offload and TX coalesce completion for P7 - Marvell Octeon EP: - xmit-more support - add PF-VF mailbox support and use it for FW notifications for VFs - Wangxun (ngbe/txgbe): - implement ethtool functions to operate pause param, ring param, coalesce channel number and msglevel - Netronome/Corigine (nfp): - add flow-steering support - support UDP segmentation offload - Ethernet NICs embedded, slower, virtual: - Xilinx AXI: remove duplicate DMA code adopting the dma engine driver - stmmac: add support for HW-accelerated VLAN stripping - TI AM654x sw: add mqprio, frame preemption & coalescing - gve: add support for non-4k page sizes. - virtio-net: support dynamic coalescing moderation - nVidia/Mellanox Ethernet datacenter switches: - allow firmware upgrade without a reboot - more flexible support for bridge flooding via the compressed FID flooding mode - Ethernet embedded switches: - Microchip: - fine-tune flow control and speed configurations in KSZ8xxx - KSZ88X3: enable setting rmii reference - Renesas: - add jumbo frames support - Marvell: - 88E6xxx: add "eth-mac" and "rmon" stats support - Ethernet PHYs: - aquantia: add firmware load support - at803x: refactor the driver to simplify adding support for more chip variants - NXP C45 TJA11xx: Add MACsec offload support - Wifi: - MediaTek (mt76): - NVMEM EEPROM improvements - mt7996 Extremely High Throughput (EHT) improvements - mt7996 Wireless Ethernet Dispatcher (WED) support - mt7996 36-bit DMA support - Qualcomm (ath12k): - support for a single MSI vector - WCN7850: support AP mode - Intel (iwlwifi): - new debugfs file fw_dbg_clear - allow concurrent P2P operation on DFS channels - Bluetooth: - QCA2066: support HFP offload - ISO: more broadcast-related improvements - NXP: better recovery in case receiver/transmitter get out of sync" * tag 'net-next-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1714 commits) lan78xx: remove redundant statement in lan78xx_get_eee lan743x: remove redundant statement in lan743x_ethtool_get_eee bnxt_en: Fix RCU locking for ntuple filters in bnxt_rx_flow_steer() bnxt_en: Fix RCU locking for ntuple filters in bnxt_srxclsrldel() bnxt_en: Remove unneeded variable in bnxt_hwrm_clear_vnic_filter() tcp: Revert no longer abort SYN_SENT when receiving some ICMP Revert "mlx5 updates 2023-12-20" Revert "net: stmmac: Enable Per DMA Channel interrupt" ipvlan: Remove usage of the deprecated ida_simple_xx() API ipvlan: Fix a typo in a comment net/sched: Remove ipt action tests net: stmmac: Use interrupt mode INTM=1 for per channel irq net: stmmac: Add support for TX/RX channel interrupt net: stmmac: Make MSI interrupt routine generic dt-bindings: net: snps,dwmac: per channel irq net: phy: at803x: make read_status more generic net: phy: at803x: add support for cdt cross short test for qca808x net: phy: at803x: refactor qca808x cable test get status function net: phy: at803x: generalize cdt fault length function net: ethernet: cortina: Drop TSO support ...
372 lines
11 KiB
C
372 lines
11 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* PS3 Platfom gelic network driver.
|
|
*
|
|
* Copyright (C) 2007 Sony Computer Entertainment Inc.
|
|
* Copyright 2006, 2007 Sony Corporation.
|
|
*
|
|
* This file is based on: spider_net.h
|
|
*
|
|
* (C) Copyright IBM Corp. 2005
|
|
*
|
|
* Authors : Utz Bacher <utz.bacher@de.ibm.com>
|
|
* Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
|
|
*/
|
|
#ifndef _GELIC_NET_H
|
|
#define _GELIC_NET_H
|
|
|
|
/* descriptors */
|
|
#define GELIC_NET_RX_DESCRIPTORS 128 /* num of descriptors */
|
|
#define GELIC_NET_TX_DESCRIPTORS 128 /* num of descriptors */
|
|
|
|
#define GELIC_NET_MAX_FRAME 2312
|
|
#define GELIC_NET_MAX_MTU 2294
|
|
#define GELIC_NET_MIN_MTU 64
|
|
#define GELIC_NET_RXBUF_ALIGN 128
|
|
#define GELIC_CARD_RX_CSUM_DEFAULT 1 /* hw chksum */
|
|
#define GELIC_NET_WATCHDOG_TIMEOUT 5*HZ
|
|
#define GELIC_NET_BROADCAST_ADDR 0xffffffffffffL
|
|
|
|
#define GELIC_NET_MC_COUNT_MAX 32 /* multicast address list */
|
|
|
|
/* virtual interrupt status register bits */
|
|
/* INT1 */
|
|
#define GELIC_CARD_TX_RAM_FULL_ERR 0x0000000000000001L
|
|
#define GELIC_CARD_RX_RAM_FULL_ERR 0x0000000000000002L
|
|
#define GELIC_CARD_TX_SHORT_FRAME_ERR 0x0000000000000004L
|
|
#define GELIC_CARD_TX_INVALID_DESCR_ERR 0x0000000000000008L
|
|
#define GELIC_CARD_RX_FIFO_FULL_ERR 0x0000000000002000L
|
|
#define GELIC_CARD_RX_DESCR_CHAIN_END 0x0000000000004000L
|
|
#define GELIC_CARD_RX_INVALID_DESCR_ERR 0x0000000000008000L
|
|
#define GELIC_CARD_TX_RESPONCE_ERR 0x0000000000010000L
|
|
#define GELIC_CARD_RX_RESPONCE_ERR 0x0000000000100000L
|
|
#define GELIC_CARD_TX_PROTECTION_ERR 0x0000000000400000L
|
|
#define GELIC_CARD_RX_PROTECTION_ERR 0x0000000004000000L
|
|
#define GELIC_CARD_TX_TCP_UDP_CHECKSUM_ERR 0x0000000008000000L
|
|
#define GELIC_CARD_PORT_STATUS_CHANGED 0x0000000020000000L
|
|
#define GELIC_CARD_WLAN_EVENT_RECEIVED 0x0000000040000000L
|
|
#define GELIC_CARD_WLAN_COMMAND_COMPLETED 0x0000000080000000L
|
|
/* INT 0 */
|
|
#define GELIC_CARD_TX_FLAGGED_DESCR 0x0004000000000000L
|
|
#define GELIC_CARD_RX_FLAGGED_DESCR 0x0040000000000000L
|
|
#define GELIC_CARD_TX_TRANSFER_END 0x0080000000000000L
|
|
#define GELIC_CARD_TX_DESCR_CHAIN_END 0x0100000000000000L
|
|
#define GELIC_CARD_NUMBER_OF_RX_FRAME 0x1000000000000000L
|
|
#define GELIC_CARD_ONE_TIME_COUNT_TIMER 0x4000000000000000L
|
|
#define GELIC_CARD_FREE_RUN_COUNT_TIMER 0x8000000000000000L
|
|
|
|
/* initial interrupt mask */
|
|
#define GELIC_CARD_TXINT GELIC_CARD_TX_DESCR_CHAIN_END
|
|
|
|
#define GELIC_CARD_RXINT (GELIC_CARD_RX_DESCR_CHAIN_END | \
|
|
GELIC_CARD_NUMBER_OF_RX_FRAME)
|
|
|
|
/* RX descriptor data_status bits */
|
|
enum gelic_descr_rx_status {
|
|
GELIC_DESCR_RXDMADU = 0x80000000, /* destination MAC addr unknown */
|
|
GELIC_DESCR_RXLSTFBF = 0x40000000, /* last frame buffer */
|
|
GELIC_DESCR_RXIPCHK = 0x20000000, /* IP checksum performed */
|
|
GELIC_DESCR_RXTCPCHK = 0x10000000, /* TCP/UDP checksup performed */
|
|
GELIC_DESCR_RXWTPKT = 0x00C00000, /*
|
|
* wakeup trigger packet
|
|
* 01: Magic Packet (TM)
|
|
* 10: ARP packet
|
|
* 11: Multicast MAC addr
|
|
*/
|
|
GELIC_DESCR_RXVLNPKT = 0x00200000, /* VLAN packet */
|
|
/* bit 20..16 reserved */
|
|
GELIC_DESCR_RXRRECNUM = 0x0000ff00, /* reception receipt number */
|
|
/* bit 7..0 reserved */
|
|
};
|
|
|
|
#define GELIC_DESCR_DATA_STATUS_CHK_MASK \
|
|
(GELIC_DESCR_RXIPCHK | GELIC_DESCR_RXTCPCHK)
|
|
|
|
/* TX descriptor data_status bits */
|
|
enum gelic_descr_tx_status {
|
|
GELIC_DESCR_TX_TAIL = 0x00000001, /* gelic treated this
|
|
* descriptor was end of
|
|
* a tx frame
|
|
*/
|
|
};
|
|
|
|
/* RX descriptor data error bits */
|
|
enum gelic_descr_rx_error {
|
|
/* bit 31 reserved */
|
|
GELIC_DESCR_RXALNERR = 0x40000000, /* alignement error 10/100M */
|
|
GELIC_DESCR_RXOVERERR = 0x20000000, /* oversize error */
|
|
GELIC_DESCR_RXRNTERR = 0x10000000, /* Runt error */
|
|
GELIC_DESCR_RXIPCHKERR = 0x08000000, /* IP checksum error */
|
|
GELIC_DESCR_RXTCPCHKERR = 0x04000000, /* TCP/UDP checksum error */
|
|
GELIC_DESCR_RXDRPPKT = 0x00100000, /* drop packet */
|
|
GELIC_DESCR_RXIPFMTERR = 0x00080000, /* IP packet format error */
|
|
/* bit 18 reserved */
|
|
GELIC_DESCR_RXDATAERR = 0x00020000, /* IP packet format error */
|
|
GELIC_DESCR_RXCALERR = 0x00010000, /* cariier extension length
|
|
* error */
|
|
GELIC_DESCR_RXCREXERR = 0x00008000, /* carrier extension error */
|
|
GELIC_DESCR_RXMLTCST = 0x00004000, /* multicast address frame */
|
|
/* bit 13..0 reserved */
|
|
};
|
|
#define GELIC_DESCR_DATA_ERROR_CHK_MASK \
|
|
(GELIC_DESCR_RXIPCHKERR | GELIC_DESCR_RXTCPCHKERR)
|
|
|
|
/* DMA command and status (RX and TX)*/
|
|
enum gelic_descr_dma_status {
|
|
GELIC_DESCR_DMA_COMPLETE = 0x00000000, /* used in tx */
|
|
GELIC_DESCR_DMA_BUFFER_FULL = 0x00000000, /* used in rx */
|
|
GELIC_DESCR_DMA_RESPONSE_ERROR = 0x10000000, /* used in rx, tx */
|
|
GELIC_DESCR_DMA_PROTECTION_ERROR = 0x20000000, /* used in rx, tx */
|
|
GELIC_DESCR_DMA_FRAME_END = 0x40000000, /* used in rx */
|
|
GELIC_DESCR_DMA_FORCE_END = 0x50000000, /* used in rx, tx */
|
|
GELIC_DESCR_DMA_CARDOWNED = 0xa0000000, /* used in rx, tx */
|
|
GELIC_DESCR_DMA_NOT_IN_USE = 0xb0000000, /* any other value */
|
|
};
|
|
|
|
#define GELIC_DESCR_DMA_STAT_MASK (0xf0000000)
|
|
|
|
/* tx descriptor command and status */
|
|
enum gelic_descr_tx_dma_status {
|
|
/* [19] */
|
|
GELIC_DESCR_TX_DMA_IKE = 0x00080000, /* IPSEC off */
|
|
/* [18] */
|
|
GELIC_DESCR_TX_DMA_FRAME_TAIL = 0x00040000, /* last descriptor of
|
|
* the packet
|
|
*/
|
|
/* [17..16] */
|
|
GELIC_DESCR_TX_DMA_TCP_CHKSUM = 0x00020000, /* TCP packet */
|
|
GELIC_DESCR_TX_DMA_UDP_CHKSUM = 0x00030000, /* UDP packet */
|
|
GELIC_DESCR_TX_DMA_NO_CHKSUM = 0x00000000, /* no checksum */
|
|
|
|
/* [1] */
|
|
GELIC_DESCR_TX_DMA_CHAIN_END = 0x00000002, /* DMA terminated
|
|
* due to chain end
|
|
*/
|
|
};
|
|
|
|
#define GELIC_DESCR_DMA_CMD_NO_CHKSUM \
|
|
(GELIC_DESCR_DMA_CARDOWNED | GELIC_DESCR_TX_DMA_IKE | \
|
|
GELIC_DESCR_TX_DMA_NO_CHKSUM)
|
|
|
|
#define GELIC_DESCR_DMA_CMD_TCP_CHKSUM \
|
|
(GELIC_DESCR_DMA_CARDOWNED | GELIC_DESCR_TX_DMA_IKE | \
|
|
GELIC_DESCR_TX_DMA_TCP_CHKSUM)
|
|
|
|
#define GELIC_DESCR_DMA_CMD_UDP_CHKSUM \
|
|
(GELIC_DESCR_DMA_CARDOWNED | GELIC_DESCR_TX_DMA_IKE | \
|
|
GELIC_DESCR_TX_DMA_UDP_CHKSUM)
|
|
|
|
enum gelic_descr_rx_dma_status {
|
|
/* [ 1 ] */
|
|
GELIC_DESCR_RX_DMA_CHAIN_END = 0x00000002, /* DMA terminated
|
|
* due to chain end
|
|
*/
|
|
};
|
|
|
|
/* for lv1_net_control */
|
|
enum gelic_lv1_net_control_code {
|
|
GELIC_LV1_GET_MAC_ADDRESS = 1,
|
|
GELIC_LV1_GET_ETH_PORT_STATUS = 2,
|
|
GELIC_LV1_SET_NEGOTIATION_MODE = 3,
|
|
GELIC_LV1_GET_VLAN_ID = 4,
|
|
GELIC_LV1_SET_WOL = 5,
|
|
GELIC_LV1_GET_CHANNEL = 6,
|
|
GELIC_LV1_POST_WLAN_CMD = 9,
|
|
GELIC_LV1_GET_WLAN_CMD_RESULT = 10,
|
|
GELIC_LV1_GET_WLAN_EVENT = 11,
|
|
};
|
|
|
|
/* for GELIC_LV1_SET_WOL */
|
|
enum gelic_lv1_wol_command {
|
|
GELIC_LV1_WOL_MAGIC_PACKET = 1,
|
|
GELIC_LV1_WOL_ADD_MATCH_ADDR = 6,
|
|
GELIC_LV1_WOL_DELETE_MATCH_ADDR = 7,
|
|
};
|
|
|
|
/* for GELIC_LV1_WOL_MAGIC_PACKET */
|
|
enum gelic_lv1_wol_mp_arg {
|
|
GELIC_LV1_WOL_MP_DISABLE = 0,
|
|
GELIC_LV1_WOL_MP_ENABLE = 1,
|
|
};
|
|
|
|
/* for GELIC_LV1_WOL_{ADD,DELETE}_MATCH_ADDR */
|
|
enum gelic_lv1_wol_match_arg {
|
|
GELIC_LV1_WOL_MATCH_INDIVIDUAL = 0,
|
|
GELIC_LV1_WOL_MATCH_ALL = 1,
|
|
};
|
|
|
|
/* status returened from GET_ETH_PORT_STATUS */
|
|
enum gelic_lv1_ether_port_status {
|
|
GELIC_LV1_ETHER_LINK_UP = 0x0000000000000001L,
|
|
GELIC_LV1_ETHER_FULL_DUPLEX = 0x0000000000000002L,
|
|
GELIC_LV1_ETHER_AUTO_NEG = 0x0000000000000004L,
|
|
|
|
GELIC_LV1_ETHER_SPEED_10 = 0x0000000000000010L,
|
|
GELIC_LV1_ETHER_SPEED_100 = 0x0000000000000020L,
|
|
GELIC_LV1_ETHER_SPEED_1000 = 0x0000000000000040L,
|
|
GELIC_LV1_ETHER_SPEED_MASK = 0x0000000000000070L,
|
|
};
|
|
|
|
enum gelic_lv1_vlan_index {
|
|
/* for outgoing packets */
|
|
GELIC_LV1_VLAN_TX_ETHERNET_0 = 0x0000000000000002L,
|
|
GELIC_LV1_VLAN_TX_WIRELESS = 0x0000000000000003L,
|
|
|
|
/* for incoming packets */
|
|
GELIC_LV1_VLAN_RX_ETHERNET_0 = 0x0000000000000012L,
|
|
GELIC_LV1_VLAN_RX_WIRELESS = 0x0000000000000013L,
|
|
};
|
|
|
|
enum gelic_lv1_phy {
|
|
GELIC_LV1_PHY_ETHERNET_0 = 0x0000000000000002L,
|
|
};
|
|
|
|
enum gelic_port_type {
|
|
GELIC_PORT_ETHERNET_0 = 0,
|
|
GELIC_PORT_WIRELESS = 1,
|
|
GELIC_PORT_MAX
|
|
};
|
|
|
|
/* As defined by the gelic hardware device. */
|
|
struct gelic_hw_regs {
|
|
struct {
|
|
__be32 dev_addr;
|
|
__be32 size;
|
|
} __packed payload;
|
|
__be32 next_descr_addr;
|
|
__be32 dmac_cmd_status;
|
|
__be32 result_size;
|
|
__be32 valid_size; /* all zeroes for tx */
|
|
__be32 data_status;
|
|
__be32 data_error; /* all zeroes for tx */
|
|
} __packed;
|
|
|
|
struct gelic_chain_link {
|
|
dma_addr_t cpu_addr;
|
|
unsigned int size;
|
|
};
|
|
|
|
struct gelic_descr {
|
|
struct gelic_hw_regs hw_regs;
|
|
struct gelic_chain_link link;
|
|
struct sk_buff *skb;
|
|
struct gelic_descr *next;
|
|
struct gelic_descr *prev;
|
|
} __attribute__((aligned(32)));
|
|
|
|
struct gelic_descr_chain {
|
|
/* we walk from tail to head */
|
|
struct gelic_descr *head;
|
|
struct gelic_descr *tail;
|
|
};
|
|
|
|
struct gelic_vlan_id {
|
|
u16 tx;
|
|
u16 rx;
|
|
};
|
|
|
|
struct gelic_card {
|
|
struct napi_struct napi;
|
|
struct net_device *netdev[GELIC_PORT_MAX];
|
|
/*
|
|
* hypervisor requires irq_status should be
|
|
* 8 bytes aligned, but u64 member is
|
|
* always disposed in that manner
|
|
*/
|
|
u64 irq_status;
|
|
u64 irq_mask;
|
|
|
|
struct ps3_system_bus_device *dev;
|
|
struct gelic_vlan_id vlan[GELIC_PORT_MAX];
|
|
int vlan_required;
|
|
|
|
struct gelic_descr_chain tx_chain;
|
|
struct gelic_descr_chain rx_chain;
|
|
/*
|
|
* tx_lock guards tx descriptor list and
|
|
* tx_dma_progress.
|
|
*/
|
|
spinlock_t tx_lock;
|
|
int tx_dma_progress;
|
|
|
|
struct work_struct tx_timeout_task;
|
|
atomic_t tx_timeout_task_counter;
|
|
wait_queue_head_t waitq;
|
|
|
|
/* only first user should up the card */
|
|
struct mutex updown_lock;
|
|
atomic_t users;
|
|
|
|
u64 ether_port_status;
|
|
int link_mode;
|
|
|
|
/* original address returned by kzalloc */
|
|
void *unalign;
|
|
|
|
/*
|
|
* each netdevice has copy of irq
|
|
*/
|
|
unsigned int irq;
|
|
struct gelic_descr *tx_top, *rx_top;
|
|
struct gelic_descr descr[]; /* must be the last */
|
|
};
|
|
|
|
struct gelic_port {
|
|
struct gelic_card *card;
|
|
struct net_device *netdev;
|
|
enum gelic_port_type type;
|
|
long priv[]; /* long for alignment */
|
|
};
|
|
|
|
static inline struct gelic_card *port_to_card(struct gelic_port *p)
|
|
{
|
|
return p->card;
|
|
}
|
|
static inline struct net_device *port_to_netdev(struct gelic_port *p)
|
|
{
|
|
return p->netdev;
|
|
}
|
|
static inline struct gelic_card *netdev_card(struct net_device *d)
|
|
{
|
|
return ((struct gelic_port *)netdev_priv(d))->card;
|
|
}
|
|
static inline struct gelic_port *netdev_port(struct net_device *d)
|
|
{
|
|
return (struct gelic_port *)netdev_priv(d);
|
|
}
|
|
static inline struct device *ctodev(struct gelic_card *card)
|
|
{
|
|
return &card->dev->core;
|
|
}
|
|
static inline u64 bus_id(struct gelic_card *card)
|
|
{
|
|
return card->dev->bus_id;
|
|
}
|
|
static inline u64 dev_id(struct gelic_card *card)
|
|
{
|
|
return card->dev->dev_id;
|
|
}
|
|
|
|
static inline void *port_priv(struct gelic_port *port)
|
|
{
|
|
return port->priv;
|
|
}
|
|
|
|
int gelic_card_set_irq_mask(struct gelic_card *card, u64 mask);
|
|
/* shared netdev ops */
|
|
void gelic_card_up(struct gelic_card *card);
|
|
void gelic_card_down(struct gelic_card *card);
|
|
int gelic_net_open(struct net_device *netdev);
|
|
int gelic_net_stop(struct net_device *netdev);
|
|
netdev_tx_t gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev);
|
|
void gelic_net_set_multi(struct net_device *netdev);
|
|
void gelic_net_tx_timeout(struct net_device *netdev, unsigned int txqueue);
|
|
int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card);
|
|
|
|
/* shared ethtool ops */
|
|
void gelic_net_get_drvinfo(struct net_device *netdev,
|
|
struct ethtool_drvinfo *info);
|
|
void gelic_net_poll_controller(struct net_device *netdev);
|
|
|
|
#endif /* _GELIC_NET_H */
|