* [PATCH 003/007] WAN Drivers: Update farsync driver and introduce fsflex driver
From: Kevin Curtis @ 2013-09-18 10:12 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Dermot Smith
Farsite Communications FarSync driver update
Patch 3 of 7
Introduce a new include file required by the fsflex driver.
Signed-off-by: Kevin Curtis <kevin.curtis@farsite.com>
---
diff -uprN -X linux-3.10.1/Documentation/dontdiff linux-3.10.1/drivers/net/wan/fscmn.h linux-3.10.1_new/drivers/net/wan/fscmn.h
--- linux-3.10.1/drivers/net/wan/fscmn.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-3.10.1_new/drivers/net/wan/fscmn.h 2013-09-16 16:30:06.779104868 +0100
@@ -0,0 +1,136 @@
+/*
+ * FarSync driver for Linux
+ *
+ * Copyright (C) 2001-2013 FarSite Communications Ltd.
+ * www.farsite.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * File : fscmn.h
+ *
+ * Description : Common FarSync Configuration Parameter Defines
+ *
+ */
+
+#ifndef INC_FSCMN
+#define INC_FSCMN
+
+#ifdef UINT32
+#define u32 UINT32
+#define u16 UINT16
+#define u8 UCHAR
+#endif
+
+#ifdef USSTYPES_H
+#define u32 U32
+#define u16 U16
+#define u8 U8
+#endif
+
+/* Interface defines */
+
+#define FSCMN_INTERFACE_AUTO 0
+#define FSCMN_INTERFACE_V24 1
+#define FSCMN_INTERFACE_X21 2
+#define FSCMN_INTERFACE_V35 3
+#define FSCMN_INTERFACE_X21D 4
+#define FSCMN_INTERFACE_NO_CABLE 5
+#define FSCMN_INTERFACE_RS530 6
+#define FSCMN_INTERFACE_RS485 7
+#define FSCMN_INTERFACE_RS485_FDX 8
+
+#define FSCMN_INTERFACE_DEFAULT FSCMN_INTERFACE_V24
+
+/* Clock source defines */
+
+#define FSCMN_CLOCK_EXTERNAL 0
+#define FSCMN_CLOCK_INTERNAL 1
+
+#define FSCMN_CLOCK_DEFAULT FSCMN_CLOCK_EXTERNAL
+
+/* Data encoding defines */
+
+#define FSCMN_ENCODING_NRZ 0x80
+#define FSCMN_ENCODING_NRZI 0xa0
+#define FSCMN_ENCODING_FM0 0xc0
+#define FSCMN_ENCODING_FM1 0xd0
+#define FSCMN_ENCODING_MANCHESTER 0xe0
+#define FSCMN_ENCODING_DMAN 0xf0
+
+#define FSCMN_ENCODING_DEFAULT FSCMN_ENCODING_NRZ
+
+/* Data type defines */
+
+#define FSCMN_MODE_HDLC 0
+#define FSCMN_MODE_TRANSPARENT 1
+#define FSCMN_MODE_BISYNC 2
+#define FSCMN_MODE_ASYNC 3
+
+#define FSCMN_MODE_DEFAULT FSCMN_MODE_HDLC
+
+/* Defines if MS or LS bit is transmitted first, LSB first for
+ * HDLC and MSB first for transparent is the usual setting
+ */
+
+#define FSCMN_BIT_ORDER_LSB_FIRST 0
+#define FSCMN_BIT_ORDER_MSB_FIRST 1
+
+#define FSCMN_BIT_ORDER_DEFAULT FSCMN_BIT_ORDER_LSB_FIRST
+
+/* Receive clock inversion defines */
+
+#define FSCMN_RXCLOCK_NORMAL 0
+#define FSCMN_RXCLOCK_INVERTED 1
+
+#define FSCMN_RXCLOCK_DEFAULT FSCMN_RXCLOCK_NORMAL
+
+/* Start type defines */
+
+#define FSCMN_START_TX 1
+#define FSCMN_START_RX 2
+#define FSCMN_START_TX_AND_RX (FSCMN_START_TX | FSCMN_START_RX)
+#define FSCMN_START_DEFAULT FSCMN_START_TX_AND_RX
+
+/* Termination defines */
+
+#define FSCMN_TERMINATION_NONE 0
+#define FSCMN_TERMINATION_RESISTIVE 1
+
+#define FSCMN_TERMINATION_DEFAULT FSCMN_TERMINATION_NONE
+
+/* Async rxFifos data format */
+
+/* Char => 1-byte data (default)
+ * Status + Char => 1-byte status + 1-byte char
+ * Status + Char + Timestamp => 1-byte status + 1-byte char + 4-byte timestamp
+ */
+
+#define FSCMN_ASYNC_RX_CHAR 0
+#define FSCMN_ASYNC_RX_STATUS_CHAR 1
+#define FSCMN_ASYNC_RX_STATUS_CHAR_TIME 2
+#define FSCMN_ASYNC_RX_CHAR_NO_ERROR 3
+
+#define FSCMN_ASYNC_RX_DEFAULT FSCMN_ASYNC_RX_CHAR
+
+typedef struct _FSCMN_TXRX_PREAMBLE {
+ u32 timestamp; /* 0x00000000 from driver to card in transmit
+ * frames 32-bit timestamp when 1st byte of
+ * receive frames
+ */
+ u16 length; /* length of frame in bytes (excl preamble) */
+ u8 port; /* port A or B */
+ u8 status; /* 0x00 from driver to card in transmit frames
+ * RSTA status byte for receive frames
+ */
+} FSCMN_TXRX_PREAMBLE, *PFSCMN_TXRX_PREAMBLE;
+
+/* conditional features */
+#define FSCMN_FEATURE_DMAN 0x01
+#define FSCMN_FEATURE_FDX485 0x02
+#define FSCMN_FEATURE_DIV 0x04
+#define FSCMN_FEATURE_TT 0x08
+
+#endif /* INC_FSCMN */
^ permalink raw reply
* [PATCH 002/007] WAN Drivers: Update farsync driver and introduce fsflex driver
From: Kevin Curtis @ 2013-09-18 10:11 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Dermot Smith
Farsite Communications FarSync driver update
Patch 2 of 7
Introduce a new include file required by the fsflex driver.
Signed-off-by: Kevin Curtis <kevin.curtis@farsite.com>
---
diff -uprN -X linux-3.10.1/Documentation/dontdiff linux-3.10.1/drivers/net/wan/uss_cmn.h linux-3.10.1_new/drivers/net/wan/uss_cmn.h
--- linux-3.10.1/drivers/net/wan/uss_cmn.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-3.10.1_new/drivers/net/wan/uss_cmn.h 2013-08-30 11:30:36.766167447 +0100
@@ -0,0 +1,492 @@
+/*
+ * FarSync driver for Linux
+ *
+ * Copyright (C) 2001-2013 FarSite Communications Ltd.
+ * www.farsite.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * File : uss_cmn.h
+ *
+ * Description : FarSync Flex common header file, shared between oncard code
+ * and Windows and Linux drivers.
+ *
+ * NOTE: all parameters are in Little Endian format
+ */
+
+#ifndef INC_USS_CMN
+#define INC_USS_CMN
+
+/* All user data frames transmitted/received to/from the FarSync Flex have an
+ * eight-byte preamble. Although the transmitter does not use all elements of
+ * the preamble, they are included to simplify loopback testing etc.
+ */
+
+#include "fscmn.h"
+
+#define RXDATA_STATUS 0x00
+#define TXDATA_STATUS 0x10
+#define SIGNAL_CHANGE 0x20
+#define TXRX_ERROR 0x30
+
+#define FLEX_TXRX_PREAMBLE FSCMN_TXRX_PREAMBLE
+#define _FLEX_TXRX_PREAMBLE _FSCMN_TXRX_PREAMBLE
+#define PFLEX_TXRX_PREAMBLE PFSCMN_TXRX_PREAMBLE
+
+/* USB Device Requests sent to the card via the default Control Pipe. */
+
+/* When bmRequestType is Vendor; bRequest is defined below.
+ * wValue is a 16-bit parameter whose use varies by command.
+ * wIndex is a 16-bit parameter that usually directs the command to a specific
+ * port, it is sometimes used in conjuncton with wValue to form a 32-bit
+ * parameter for some of the memory access commands.
+ * wLength is is 16-bit paremeter that defines the amount of data associated
+ * with a command. Valid range is zero (no data) to 256 maximum (bytes).
+ * Data is a variable length block containing data specific to each command.
+ */
+
+/* command code */
+
+typedef enum _USS_COMMANDS {
+ USS_CMD_GET_VERSION = 1, /* 0x01 */
+ USS_CMD_READ_FLASH, /* 0x02 */
+ USS_CMD_WRITE_FLASH, /* 0x03 */
+ USS_CMD_ERASE_FLASH, /* 0x04 */
+
+ USS_CMD_START_PORT, /* 0x05 */
+ USS_CMD_STOP_PORT, /* 0x06 */
+ USS_CMD_ABORT_PORT, /* 0x07 */
+
+ USS_CMD_SET_CONFIG, /* 0x08 */
+ USS_CMD_GET_CONFIG, /* 0x09 */
+
+ USS_CMD_SET_SIGNALS, /* 0x0A */
+ USS_CMD_GET_SIGNALS, /* 0x0B */
+
+ USS_CMD_START_BREAK, /* 0x0C */
+ USS_CMD_STOP_BREAK, /* 0x0D */
+
+ USS_CMD_SEND_XON, /* 0x0E */
+ USS_CMD_SEND_XOFF, /* 0x0F */
+
+ USS_CMD_RESET_STATS, /* 0x10 */
+
+ USS_CMD_RESET_TIME, /* 0x11 */
+
+ USS_CMD_FLUSH_BUFFERS, /* 0x12 */
+
+ USS_CMD_SET_DEBUG_LEVEL, /* 0x13 */
+
+ USS_CMD_SEND_SECURE_MSG, /* 0x14 */
+ USS_CMD_RECV_SECURE_RSP, /* 0x15 */
+
+ USS_CMD_SET_INTERFACE, /* 0x16 */
+ USS_CMD_GET_INTERFACE, /* 0x17 */
+
+ USS_CMD_SET_TERMINATION, /* 0x18 */
+ USS_CMD_GET_TERMINATION, /* 0x19 */
+
+ USS_CMD_SET_LINESPEED, /* 0x1A */
+ USS_CMD_GET_LINESPEED, /* 0x1B */
+
+ USS_CMD_SET_CLOCK_SOURCE, /* 0x1C */
+ USS_CMD_GET_CLOCK_SOURCE, /* 0x1D */
+
+ USS_CMD_SET_ENCODING, /* 0x1E */
+ USS_CMD_GET_ENCODING, /* 0x1F */
+
+ USS_CMD_SET_DATA_MODE, /* 0x20 */
+ USS_CMD_GET_DATA_MODE, /* 0x21 */
+
+ USS_CMD_SET_SYNC_CHAR, /* 0x22 */
+ USS_CMD_GET_SYNC_CHAR, /* 0x23 */
+
+ USS_CMD_SET_BIT_ORDER, /* 0x24 */
+ USS_CMD_GET_BIT_ORDER, /* 0x25 */
+
+ USS_CMD_SET_RXC_INVERT, /* 0x26 */
+ USS_CMD_GET_RXC_INVERT, /* 0x27 */
+
+ USS_CMD_SET_START_MODE, /* 0x28 */
+ USS_CMD_GET_START_MODE, /* 0x29 */
+
+ USS_CMD_SET_NUM_TX_BUFFER, /* 0x2A */
+ USS_CMD_GET_NUM_TX_BUFFER, /* 0x2B */
+
+ USS_CMD_SET_NUM_RX_BUFFER, /* 0x2C */
+ USS_CMD_GET_NUM_RX_BUFFER, /* 0x2D */
+
+ USS_CMD_SET_SIZE_TX_BUFFER, /* 0x2E */
+ USS_CMD_GET_SIZE_TX_BUFFER, /* 0x2F */
+
+ USS_CMD_SET_SIZE_RX_BUFFER, /* 0x30 */
+ USS_CMD_GET_SIZE_RX_BUFFER, /* 0x31 */
+
+ USS_CMD_SET_DATA_BITS, /* 0x32 */
+ USS_CMD_GET_DATA_BITS, /* 0x33 */
+
+ USS_CMD_SET_PARITY, /* 0x34 */
+ USS_CMD_GET_PARITY, /* 0x35 */
+
+ USS_CMD_SET_STOP_BITS, /* 0x36 */
+ USS_CMD_GET_STOP_BITS, /* 0x37 */
+
+ USS_CMD_SET_FLOW_CONTROL, /* 0x38 */
+ USS_CMD_GET_FLOW_CONTROL, /* 0x39 */
+
+ USS_CMD_SET_RX_TIMEOUT_ENABLE, /* 0x3A */
+ USS_CMD_GET_RX_TIMEOUT_ENABLE, /* 0x3B */
+
+ USS_CMD_SET_RX_TIMEOUT_LENGTH, /* 0x3C */
+ USS_CMD_GET_RX_TIMEOUT_LENGTH, /* 0x3D */
+
+ USS_CMD_RESET_PORT_STATS, /* 0x3E */
+ USS_CMD_GET_PORT_STATS, /* 0x3F */
+
+ USS_CMD_SET_IDENTIFY_MODE, /* 0x40 */
+ USS_CMD_GET_CARD_INFO, /* 0x41 */
+
+ USS_CMD_RESET_USB_STATS, /* 0x42 */
+ USS_CMD_GET_USB_STATS, /* 0x43 */
+
+ USS_CMD_SET_LOOP_MODE, /* 0x44 */
+ USS_CMD_GET_LOOP_MODE, /* 0x45 */
+
+ USS_CMD_GET_CLOCK_STATUS, /* 0x46 */
+ USS_CMD_GET_CLOCK_RATE, /* 0x47 */
+
+ USS_CMD_SET_MONITOR_MODE, /* 0x48 */
+ USS_CMD_GET_MONITOR_MODE, /* 0x49 */
+
+ USS_CMD_SET_EXTENDED_CLOCKING, /* 0x4A */
+ USS_CMD_GET_EXTENDED_CLOCKING, /* 0x4B */
+
+ USS_CMD_SET_INTERNAL_TX_CLOCK, /* 0x4C */
+ USS_CMD_GET_INTERNAL_TX_CLOCK, /* 0x4D */
+
+ USS_CMD_SET_INTERNAL_RX_CLOCK, /* 0x4E */
+ USS_CMD_GET_INTERNAL_RX_CLOCK, /* 0x4F */
+
+ USS_CMD_SET_ENABLE_NRZI_CLOCKING, /* 0x50 */
+ USS_CMD_GET_ENABLE_NRZI_CLOCKING, /* 0x51 */
+
+ USS_CMD_SET_XON_CHAR, /* 0x52 */
+ USS_CMD_GET_XON_CHAR, /* 0x53 */
+
+ USS_CMD_SET_XOFF_CHAR, /* 0x54 */
+ USS_CMD_GET_XOFF_CHAR, /* 0x55 */
+
+ USS_CMD_SET_PRESERVE_SIGNALS, /* 0x56 */
+ USS_CMD_GET_PRESERVE_SIGNALS, /* 0x57 */
+
+ USS_CMD_SET_ASYNC_RX_MODE, /* 0x58 */
+ USS_CMD_GET_ASYNC_RX_MODE, /* 0x59 */
+
+ USS_CMD_INJECT_ERRORS, /* 0x5A */
+
+ USS_CMD_SOFT_RESET, /* 0x5B */
+
+ USS_CMD_SET_CRC_RESET, /* 0x5C */
+ USS_CMD_GET_CRC_RESET, /* 0x5D */
+
+ USS_CMD_SET_EXT_CONFIG, /* 0x5E */
+ USS_CMD_GET_EXT_CONFIG, /* 0x5F */
+
+ USS_CMD_GET_CAPABILITY_MASK, /* 0x60 */
+ USS_CMD_GET_FEATURE_MASK, /* 0x61 */
+
+ USS_CMD_SEND_MARK, /* 0x62 */
+
+ /* others to be added... */
+
+ USS_CMD_MAX /* 0x0 */
+} USS_COMMANDS;
+
+/* Port Configuration Structure */
+
+typedef struct {
+#define FLEX_SERCONF_VERSION 8
+
+ u32 u_version; /* Version of this structure */
+ u32 iface; /* interface type */
+ u32 termination; /* interface termination */
+ u32 line_speed; /* data rate in bps */
+ u32 clock; /* clock source */
+ u32 encoding; /* data encoding */
+ u32 mode; /* data mode */
+ u32 sync_char; /* Monosync/Bisync sync characters */
+ u32 bit_order; /* Tx/Rx MSB first */
+ u32 rxclock; /* receive clock inversion */
+ u32 start; /* tx and rx start */
+ u32 num_tx_buffer;
+ u32 num_rx_buffer;
+ u32 size_tx_buffer;
+ u32 size_rx_buffer;
+ u32 data_bits; /* async data bits */
+ u32 parity; /* async parity bits */
+ u32 stopbits; /* async stop bits */
+ u32 flow_control; /* async flow control */
+ u32 timeout_enable; /* async timeout enable */
+ u32 timeout_length; /* async timeout length */
+ u32 monitor_mode; /* open port in monitor mode,
+ * when TRUE - added VERSION 2
+ */
+ u32 extended_clocking; /* when TRUE, the following overrides clock
+ * parameter - added VERSION 3
+ */
+ u32 internal_tx_clock; /* independent control over transmit clock,
+ * TRUE => internal
+ */
+ u32 internal_rx_clock; /* independent control over receive clock,
+ * TRUE => internal
+ */
+ u32 enable_nrzi_clocking; /* clocking provided with NRZI data
+ * when TRUE - added VERSION 4
+ */
+ u32 xonchar; /* xon character, 0 => default
+ * (ctrl-Q, 0x11)
+ */
+ u32 xoffchar; /* xoff character, 0 => default
+ * (ctrl-S, 0x13)
+ */
+ u32 preserve_signals; /* preserve signals on port closure,
+ * when TRUE - added VERSION 5
+ */
+ u32 async_receive_mode; /* async specifies format of fifo rx data
+ * - added VERSION 6
+ */
+ u32 crc_reset; /* CRC initial value reset - added VERSION 7 */
+ u32 extended_config; /* Extended Configuration - added VERSION 8 */
+} FLEX_SERCONF, *PFLEX_SERCONF;
+
+/* Card Information */
+
+typedef struct {
+#define FFCARDINFO_VERSION 1
+
+ u32 u_version; /* Version number of this structure */
+
+ u8 sz_serial_no[16]; /* FarSync Flex serial number */
+ u32 u_major_rev; /* Major hardware revision number */
+ u32 u_minor_rev; /* Minor hardware revision number */
+ u32 u_build_state; /* FarSync Flex build state */
+ u32 u_cpu_speed; /* ARM 7 CPU speed */
+ u32 u_mode; /* Internal card mode */
+
+ u32 u_software_version; /* Version number of running code */
+ u32 u_arm_version; /* USS2828 CHIP_VERSION register */
+ u32 uflash_manf_id; /* Manufacturer ID of FLASH */
+ u32 uflash_dev_id; /* Device ID of FLASH */
+ u32 u_serocco_version; /* SEROCCO-M VER3..0 registers */
+
+ u32 spare[17];
+} FLEX_CARD_INFO, *PFLEX_CARD_INFO; /* sizeof(FLEX_CARD_INFO) = 128 */
+
+/* USB statistics counters maintained by Flex hardware, modulo 65536 */
+
+typedef struct {
+ u32 u_rx_packet_counter; /* number of packets received by USB
+ * (16-bit)
+ */
+ u32 u_packet_dropped; /* packets dropped by USB
+ * (16-bit)
+ */
+ u32 u_crc_error; /* CRC errors in token or data packets
+ * (16-bit)
+ */
+ u32 u_bit_stuff_error; /* bit stuff errors (16-bit) */
+ u32 u_pid_error; /* errors in PID fields (16-bit) */
+ u32 u_framing_error; /* errors in SYNC and EOP fields (16-bit) */
+ u32 u_tx_packet_counter; /* number of packets transmitted by USB
+ * (16-bit)
+ */
+ u32 u_stat_counter_overflow; /* overflows in previous counters
+ * ( 8-bit)
+ */
+} FLEX_USB_STATS, *PFLEX_USB_STATS;
+
+/* Configuration Parameter Defines */
+
+/* Async data bits defines */
+
+#define COM_DATA_BITS_8 0
+#define COM_DATA_BITS_7 1
+#define COM_DATA_BITS_6 2
+#define COM_DATA_BITS_5 3
+
+#define COM_DATA_BITS_DEFAULT COM_DATA_BITS_8
+
+/* Async parity defines */
+
+#define COM_NO_PARITY 0
+#define COM_ODD_PARITY 1
+#define COM_EVEN_PARITY 2
+#define COM_FORCE_PARITY_1 3
+#define COM_FORCE_PARITY_0 4
+
+#define COM_PARITY_DEFAULT COM_NO_PARITY
+
+/* Async stop bit defines */
+
+#define COM_STOP_BITS_1 0
+#define COM_STOP_BITS_1_5 1
+#define COM_STOP_BITS_2 2
+
+#define COM_STOP_DEFAULT COM_STOP_BITS_1
+
+/* Async flow control defines */
+
+#define COM_FLOW_CONTROL_NONE 1
+#define COM_FLOW_CONTROL_RTSCTS 2
+#define COM_FLOW_CONTROL_XONXOFF 3
+
+#define COM_FLOW_CONTROL_DEFAULT COM_FLOW_CONTROL_NONE
+
+/* Flush buffers defines */
+
+#define FLUSH_TX_BUFFERS 1
+#define FLUSH_RX_BUFFERS 2
+
+/* Async timeout enable defines */
+
+#define COM_RX_TIMEOUT_DISABLE 0
+#define COM_RX_TIMEOUT_ENABLE 1
+
+#define COM_RX_TIMEOUT_DEFAULT COM_RX_TIMEOUT_DISABLE
+
+/* Async timeout length defines */
+
+/* Loopback mode defines */
+
+#define FLEX_LOOP_NONE 0
+#define FLEX_LOOP_USB 1
+#define FLEX_LOOP_SERIAL 2
+
+#define FLEX_LOOP_DEFAULT FLEX_LOOP_NONE
+
+/* Extended Configuration defines */
+
+#define EXT_CONFIG_NONE 0
+#define EXT_CONFIG_RTT 1
+#define EXT_CONFIG_TTT 2
+#define EXT_CONFIG_RIV 4
+#define EXT_CONFIG_TIV 8
+
+#define EXT_CONFIG_DEFAULT EXT_CONFIG_NONE
+
+#endif /* INC_USS_CMN */
+
+/*****************************************************************************/
+/* Structure for the device driver interface record. */
+/*****************************************************************************/
+
+#define CEDSTCRC 0 /* Frames received with incorrect CRC */
+#define CEDSTOFL 1 /* Frames received longer than the maximum */
+#define CEDSTUFL 2 /* Frames received less than 4 octets long */
+#define CEDSTSPR 3 /* Frames received ending on a non-octet
+ * bndry
+ */
+#define CEDSTABT 4 /* Aborted frames received */
+#define CEDSTTXU 5 /* Transmitter interrupt underruns */
+#define CEDSTRXO 6 /* Receiver interrupt overruns */
+#define CEDSTDCD 7 /* DCD (RLSD) lost during frame reception */
+#define CEDSTCTS 8 /* CTS lost while transmitting */
+#define CEDSTDSR 9 /* DSR drops */
+#define CEDSTHDW 10 /* Hardware failures - adapter errors */
+
+#define CEDSTMAX 11
+
+#define SACRCERROR CEDSTCRC
+#define SARXFRAMETOOBIG CEDSTOFL
+#define SARXFRAMETOOSHORT CEDSTUFL
+#define SASPARE CEDSTSPR
+#define SARXABORT CEDSTABT
+#define SATXUNDERRUN CEDSTTXU
+#define SARXOVERRUN CEDSTRXO
+#define SADCDDROP CEDSTDCD
+#define SACTSDROP CEDSTCTS
+#define SADSRDROP CEDSTDSR
+#define SAHARDWAREERROR CEDSTHDW
+
+/* FarSync-specific counters mapped to existing SDCI definitions */
+#define SAFRAMINGERROT SASARE
+#define SARXERROR SAHARDWAREERROR
+#define SABUFFERUNAVAILABLE SADCDDROP
+#define SAPARITY SACRCERROR
+
+#define SAMAXSTAT CEDSTMAX
+
+#define STATUS_SUCCESS 0x80
+#define STATUS_PENDING 0x00
+#define STATUS_UNSUCCESSFUL 0x90
+#define STATUS_CANCELLED 0xC0
+
+/* ***************************************************************************
+ * FarSync supports the following counters. All other counter indices are not
+ * used by FarSync.
+ * SA_CRC_Error Sync & Async modes
+ * SA_FramingError Sync & Async modes
+ * SA_RxOverrun Sync & Async modes
+ * SA_RxAbort (Async) & (M1P Sync) modes only
+ * SA_RxError Sync mode only
+ * SA_TxUnderrun Sync mode only
+ * SA_RxFrameTooShort M1P Sync mode only
+ * SA_RxFrameTooBig Async mode (fifo overflow) & M1P Sync
+ * Note that
+ * 1) Async mode is currently only supported on the T4U - it is an
+ * optional extra feature
+ * 2) On a TxU an SA_RxError indicates a received abort OR a rx frame
+ * length error
+ * (too big OR too small)
+ * 3) On an M1P an SA_RxError indicates a alternative type of RxO as
+ * reported via
+ * SA_RxOverrun
+ * ***************************************************************************
+ */
+
+/*****************************************************************************/
+/* InterfaceRecord definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeReadInterfaceRecord, */
+/* IoctlCodeFarSyncReadInterfaceRecord */
+/* */
+/*****************************************************************************/
+typedef struct _INTERFACE_RECORD {
+ int rx_frame_count; /* incremented after each frame rx'd */
+ int tx_max_fr_size_now; /* max available frame size av. now */
+ /* (changes after each Tx DevIoctl */
+ /* to DD or after Tx completed) */
+ int status_count; /* How many status events have been */
+ /* triggered. */
+ u8 v24_in; /* Last 'getv24 i/p' value got */
+ u8 v24_out; /* Last 'setv24 o/p' value set */
+
+/* The values for the indexes into the link statistics array of the */
+/* various types of statistic. */
+
+ int status_array[SAMAXSTAT];
+
+} IR, *PIR;
+
+/*****************************************************************************/
+/* InterfaceRecordEx definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncReadInterfaceRecordEx */
+/* */
+/*****************************************************************************/
+typedef struct _INTERFACE_RECORD_EX {
+ IR interface_record;
+ int status_count; /* How many status events have been */
+ u32 opened_count;
+ u32 tx_request_count;
+ u32 tx_complete_count;
+ u32 rx_posted_count;
+ u32 rx_complete_count;
+} IREX, *PIREX;
^ permalink raw reply
* [PATCH 001/007] WAN Drivers: Update farsync driver and introduce fsflex driver
From: Kevin Curtis @ 2013-09-18 10:11 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Dermot Smith
Farsite Communications FarSync driver update
Patch 1 of 7
Add new FarSite PCI ID's to the pci_ids.h file
Signed-off-by: Kevin Curtis <kevin.curtis@farsite.com>
---
diff -uprN -X linux-3.10.1/Documentation/dontdiff linux-3.10.1/include/linux/pci_ids.h linux-3.10.1_new/include/linux/pci_ids.h
--- linux-3.10.1/include/linux/pci_ids.h 2013-07-13 19:42:41.000000000 +0100
+++ linux-3.10.1_new/include/linux/pci_ids.h 2013-07-26 11:18:39.821065185 +0100
@@ -2284,6 +2284,14 @@
#define PCI_DEVICE_ID_FARSITE_T4U 0x0640
#define PCI_DEVICE_ID_FARSITE_TE1 0x1610
#define PCI_DEVICE_ID_FARSITE_TE1C 0x1612
+#define PCI_DEVICE_ID_FARSITE_DSL_S1 0x2610
+#define PCI_DEVICE_ID_FARSITE_T4E 0x3640
+#define PCI_DEVICE_ID_FARSITE_T4UE 0x4640
+#define PCI_DEVICE_ID_FARSITE_T2UE 0x4620
+#define PCI_DEVICE_ID_FARSITE_T2U_PMC 0x6620
+#define PCI_DEVICE_ID_FARSITE_T2Ee 0x5621
+#define PCI_DEVICE_ID_FARSITE_T4Ee 0x5641
+
#define PCI_VENDOR_ID_ARIMA 0x161f
^ permalink raw reply
* [PATCH] net/lapb: re-send packets on timeout
From: Josselin Costanzi @ 2013-09-18 10:00 UTC (permalink / raw)
To: netdev; +Cc: Josselin Costanzi, Maxime Jayat
Actually re-send packets when the T1 timer runs out. This fixes a bug
where packets are waiting on the write queue until disconnection when
no other traffic is outstanding.
Signed-off-by: Josselin Costanzi <josselin.costanzi@mobile-devices.fr>
Signed-off-by: Maxime Jayat <maxime.jayat@mobile-devices.fr>
---
net/lapb/lapb_timer.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/lapb/lapb_timer.c b/net/lapb/lapb_timer.c
index 54563ad..355cc3b 100644
--- a/net/lapb/lapb_timer.c
+++ b/net/lapb/lapb_timer.c
@@ -154,6 +154,7 @@ static void lapb_t1timer_expiry(unsigned long param)
} else {
lapb->n2count++;
lapb_requeue_frames(lapb);
+ lapb_kick(lapb);
}
break;
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCH v3 net-next 10/27] bonding: use bond_for_each_slave() in bond_uninit()
From: Veaceslav Falico @ 2013-09-18 9:53 UTC (permalink / raw)
To: netdev; +Cc: jiri, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1379378812-18346-11-git-send-email-vfalico@redhat.com>
On Tue, Sep 17, 2013 at 02:46:35AM +0200, Veaceslav Falico wrote:
>We're safe agains removal there, cause we use neighbours primitives.
>
>CC: Jay Vosburgh <fubar@us.ibm.com>
>CC: Andy Gospodarek <andy@greyhouse.net>
>Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
>---
>
>Notes:
> v2 -> v3:
> No change.
>
> v1 -> v2:
> No changes.
>
> RFC -> v1:
> Move the patch rigth after we start using neighbour lists for
> bond_for_each_slave().
>
> drivers/net/bonding/bond_main.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index cdd5c5f..2075321 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -4090,12 +4090,13 @@ static void bond_setup(struct net_device *bond_dev)
> static void bond_uninit(struct net_device *bond_dev)
> {
> struct bonding *bond = netdev_priv(bond_dev);
>- struct slave *slave, *tmp_slave;
>+ struct list_head *iter;
>+ struct slave *slave;
>
> bond_netpoll_cleanup(bond_dev);
>
> /* Release the bonded slaves */
>- list_for_each_entry_safe(slave, tmp_slave, &bond->slave_list, list)
>+ bond_for_each_slave(bond, slave, iter)
> __bond_release_one(bond_dev, slave->dev, true);
Seems like we're not really safe here, however it's easily fixable if the
*iter in netdev_for_each_lower_private() will contain the ->next pointer,
just as in list_for_each_entry_safe().
I'll fix it in the next version, something like that:
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b487302..e101f5a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2839,7 +2839,7 @@ extern void *netdev_lower_get_next_private_rcu(struct net_device *dev,
struct list_head **iter);
#define netdev_for_each_lower_private(dev, priv, iter) \
- for (iter = &(dev)->adj_list.lower, \
+ for (iter = (dev)->adj_list.lower.next, \
priv = netdev_lower_get_next_private(dev, &(iter)); \
priv; \
priv = netdev_lower_get_next_private(dev, &(iter)))
diff --git a/net/core/dev.c b/net/core/dev.c
index 5fe2dd0..8bd0c43 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4563,7 +4563,7 @@ void *netdev_lower_get_next_private(struct net_device *dev,
struct netdev_adjacent *lower;
if (iter)
- lower = list_entry((*iter)->next, struct netdev_adjacent,
+ lower = list_entry(*iter, struct netdev_adjacent,
list);
else
lower = list_entry(dev->adj_list.lower.next,
@@ -4573,7 +4573,7 @@ void *netdev_lower_get_next_private(struct net_device *dev,
return NULL;
if (iter)
- *iter = &lower->list;
+ *iter = lower->list.next;
return lower->private;
}
> pr_info("%s: released all slaves\n", bond_dev->name);
>
>--
>1.8.4
>
^ permalink raw reply related
* [PULL] vhost: minor changes on top of 3.12-rc1
From: Michael S. Tsirkin @ 2013-09-18 9:49 UTC (permalink / raw)
To: Linus Torvalds
Cc: kvm, mst, netdev, linux-kernel, virtualization, qinchuanyu,
alonid
The following changes since commit 272b98c6455f00884f0350f775c5342358ebb73f:
Linux 3.12-rc1 (2013-09-16 16:17:51 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus
for you to fetch changes up to d3d665a654a35c47463d2aa6353bac3ce293f4f5:
vhost-scsi: whitespace tweak (2013-09-17 22:56:09 +0300)
----------------------------------------------------------------
vhost: minor changes on top of 3.12-rc1
This fixes module loading for vhost-scsi, and tweaks locking in vhost core
a bit. Both of these are not exactly release blockers but it's early
in the cycle so I think it's a good idea to apply them now.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
----------------------------------------------------------------
Michael S. Tsirkin (2):
vhost/scsi: use vmalloc for order-10 allocation
vhost-scsi: whitespace tweak
Qin Chuanyu (1):
vhost: wake up worker outside spin_lock
drivers/vhost/scsi.c | 43 ++++++++++++++++++++++++++++---------------
drivers/vhost/vhost.c | 4 +++-
2 files changed, 31 insertions(+), 16 deletions(-)
^ permalink raw reply
* Re: [RFC PATCHv2 3/4] of: provide a binding for fixed link PHYs
From: Florian Fainelli @ 2013-09-18 9:21 UTC (permalink / raw)
To: Grant Likely
Cc: Thomas Petazzoni, David S. Miller, netdev,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Lior Amsalem,
Mark Rutland, Sascha Hauer, Christian Gmeiner, Ezequiel Garcia,
Gregory Clement,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
In-Reply-To: <20130918042923.5D845C42CF7-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
Hello,
2013/9/18 Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>:
> On Fri, 6 Sep 2013 17:18:20 +0200, Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
>> Some Ethernet MACs have a "fixed link", and are not connected to a
>> normal MDIO-managed PHY device. For those situations, a Device Tree
>> binding allows to describe a "fixed link" using a special PHY node.
>>
>> This patch adds:
>>
>> * A documentation for the fixed PHY Device Tree binding.
>>
>> * An of_phy_is_fixed_link() function that an Ethernet driver can call
>> on its PHY phandle to find out whether it's a fixed link PHY or
>> not. It should typically be used to know if
>> of_phy_register_fixed_link() should be called.
>>
>> * An of_phy_register_fixed_link() function that instantiates the
>> fixed PHY into the PHY subsystem, so that when the driver calls
>> of_phy_connect(), the PHY device associated to the OF node will be
>> found.
>>
>> Signed-off-by: Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
>
> Hi Thomas,
>
> The implemenation in this series looks like it is in good shape, so I'll
> restrict my comments to be binding...
>
>> ---
>> .../devicetree/bindings/net/fixed-link.txt | 34 ++++++++++++++++++++++
>> drivers/of/of_mdio.c | 24 +++++++++++++++
>> include/linux/of_mdio.h | 15 ++++++++++
>> 3 files changed, 73 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/net/fixed-link.txt
>>
>> diff --git a/Documentation/devicetree/bindings/net/fixed-link.txt b/Documentation/devicetree/bindings/net/fixed-link.txt
>> new file mode 100644
>> index 0000000..9f2a1a50
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/fixed-link.txt
>> @@ -0,0 +1,34 @@
>> +Fixed link Device Tree binding
>> +------------------------------
>> +
>> +Some Ethernet MACs have a "fixed link", and are not connected to a
>> +normal MDIO-managed PHY device. For those situations, a Device Tree
>> +binding allows to describe a "fixed link".
>> +
>> +Such a fixed link situation is described by creating a PHY node as a
>> +sub-node of an Ethernet device, with the following properties:
>> +
>> +* 'fixed-link' (boolean, mandatory), to indicate that this PHY is a
>> + fixed link PHY.
>> +* 'speed' (integer, mandatory), to indicate the link speed. Accepted
>> + values are 10, 100 and 1000
>> +* 'full-duplex' (boolean, optional), to indicate that full duplex is
>> + used. When absent, half duplex is assumed.
>> +* 'pause' (boolean, optional), to indicate that pause should be
>> + enabled.
>> +* 'asym-pause' (boolean, optional), to indicate that asym_pause should
>> + be enabled.
>
> I understand what you're trying to do here, but it causes a troublesome
> leakage of implementation detail into the binding, making the whole
> thing look very odd. This binding tries to make a fixed link look
> exactly like a real PHY even to the point of including a phandle to the
> phy. But having a phandle to a node which is *always* a direct child of
> the MAC node is redundant and a rather looney. Yes, doing it that way
> makes it easy for of_phy_find_device() to be transparent for fixed link,
> but that should *not* drive bindings, especially when that makes the
> binding really rather weird.
This is not exactly true in the sense that the "new" binding just
re-shuffles the properties representation into something that is
clearer and more extendible but there is not much difference in the
semantics.
>
> Second, this new binding doesn't provide anything over and above the
> existing fixed-link binding. It may not be pretty, but it is
> estabilshed.
In fact it does, the old one is obscure and not easily extendable
because we rely on an integer array to represent the various
properties, so at least this new one makes it easy to extend the
binding to support a possibly new fixed-link property. Being able to
deprecate a fundamentaly badly designed binding should still be a
prerogative, software is flexible and can deal with both with little
cost.
>
> That said, I do agree that the current Linux implementation is not good
> because it cannot handle a fixed-link property transparently. That's a
> deficiency in the Linux implementation and it should be fixed.
> of_phy_connect() currently requires the phy phandle to be passed in.
> Part of the reason it was done this way is that some drivers connect to
> multiple 'phys'. A soulition could be to make the phy handle optional.
> If it is empty then go looking for either a phy-device or fixed-link
> property. Otherwise use the provided node.
I do not quite follow you on this one, and I fear we might be leaking
some Linux probing heuristic into Device Tree bindings by implicitely
saying "not including a PHY phandle means connecting to a fixed-PHY
link." This would also dramatically change the current behavior for
most drivers where they might refuse probing if no corresponding PHY
device node is present and they are not designed to connect to a fixed
PHY one.
--
Florian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [REGRESSION][BISECTED] skge: add dma_mapping check
From: Igor Gnatenko @ 2013-09-18 9:00 UTC (permalink / raw)
To: Mirko Lindner; +Cc: linux-kernel, Stephen Hemminger, netdev
Since 136d8f377e1575463b47840bc5f1b22d94bf8f63 commit we have kernel
panic on:
01:05.0 Ethernet controller [0200]: Marvell Technology Group Ltd.
Screen: https://www.dropbox.com/s/mu3t3wxpxbn4ou5/IMAG0507.jpg
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1008323
01:05.0 Ethernet controller [0200]: Marvell Technology Group Ltd.
88E8001 Gigabit Ethernet Controller [11ab:4320] (rev 13)
Subsystem: ASUSTeK Computer Inc. Marvell 88E8001 Gigabit
Ethernet Controller (Asus) [1043:811a]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 64 (5750ns min, 7750ns max), Cache Line Size: 16 bytes
Interrupt: pin A routed to IRQ 21
Region 0: Memory at ddcfc000 (32-bit, non-prefetchable)
[size=16K]
Region 1: I/O ports at a800 [size=256]
Expansion ROM at ddcc0000 [disabled] [size=128K]
Capabilities: [48] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1
+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=7 DScale=1 PME-
Capabilities: [50] Vital Product Data
Product Name: Yukon Gigabit Ethernet 10/100/1000Base-T
Adapter
Read-only fields:
[PN] Part number: Yukon 88E8001
[EC] Engineering changes: Rev. 1.3
[MN] Manufacture ID: 4d 61 72 76 65 6c 6c
[SN] Serial number: AbCdEfG000002
[CP] Extended capability: 01 10 cc 03
[RV] Reserved: checksum good, 10 byte(s)
reserved
Read/write fields:
[RW] Read-write area: 121 byte(s) free
End
Kernel driver in use: skge
--
Igor Gnatenko
Fedora release 20 (Heisenbug)
Linux 3.11.1-300.fc20.x86_64
^ permalink raw reply
* [PATCH net 0/2] Fix cnic regressions
From: Michael Chan @ 2013-09-18 8:50 UTC (permalink / raw)
To: davem; +Cc: netdev, Michael Chan
Fix regressions caused by Doorbell change and macro change.
Ariel Elior (1):
bnx2x, cnic, bnx2i, bnx2fc: Fix bnx2i and bnx2fc regressions.
Michael Chan (1):
cnic: Fix crash in cnic_bnx2x_service_kcq()
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 36 ++++++++++++++++++++--
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 4 ++
drivers/net/ethernet/broadcom/cnic.c | 6 ++-
drivers/scsi/bnx2fc/bnx2fc.h | 2 +-
drivers/scsi/bnx2fc/bnx2fc_hwi.c | 3 +-
drivers/scsi/bnx2i/bnx2i.h | 2 +-
drivers/scsi/bnx2i/bnx2i_hwi.c | 3 +-
7 files changed, 45 insertions(+), 11 deletions(-)
^ permalink raw reply
* [PATCH net 2/2] cnic: Fix crash in cnic_bnx2x_service_kcq()
From: Michael Chan @ 2013-09-18 8:50 UTC (permalink / raw)
To: davem; +Cc: netdev, Michael Chan
In-Reply-To: <1379494239-5481-2-git-send-email-mchan@broadcom.com>
commit 104a43edb264321a4d41850e98153b4fa8a9ef42
cnic: Use CHIP_NUM macros from bnx2x.h
changed the code to use the bnx2x macro NO_FCOE() to determine if FCoE
is supported or not. There is another place in cnic that is still using
the old method to determine if FCoE is supported or not. The 2 methods
may not yield the same result after the network interface is brought down
and up. This will cause the crash as cnic_bnx2x_service_kcq() will access
the uninitialized cp->kcq2.
The fix is to consistently use the same macro CNIC_SUPPORTS_FCOE() which
uses the bnx2x NO_FCOE() macro. As a follow-up, we can clean up the code
to remove the old method as it is no longer needed.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/cnic.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 93da16b..99394bd 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -3135,6 +3135,7 @@ static void cnic_service_bnx2x_bh(unsigned long data)
{
struct cnic_dev *dev = (struct cnic_dev *) data;
struct cnic_local *cp = dev->cnic_priv;
+ struct bnx2x *bp = netdev_priv(dev->netdev);
u32 status_idx, new_status_idx;
if (unlikely(!test_bit(CNIC_F_CNIC_UP, &dev->flags)))
@@ -3146,7 +3147,7 @@ static void cnic_service_bnx2x_bh(unsigned long data)
CNIC_WR16(dev, cp->kcq1.io_addr,
cp->kcq1.sw_prod_idx + MAX_KCQ_IDX);
- if (cp->ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE) {
+ if (!CNIC_SUPPORTS_FCOE(bp)) {
cp->arm_int(dev, status_idx);
break;
}
--
1.7.1
^ permalink raw reply related
* [PATCH net 1/2] bnx2x, cnic, bnx2i, bnx2fc: Fix bnx2i and bnx2fc regressions.
From: Michael Chan @ 2013-09-18 8:50 UTC (permalink / raw)
To: davem; +Cc: netdev, Michael Chan, Ariel Elior, Eddie Wai
In-Reply-To: <1379494239-5481-1-git-send-email-mchan@broadcom.com>
commit b9871bcfd211d316adee317608dab44c58d6ea2d
bnx2x: VF RSS support - PF side
changed the configuration of the doorbell HW and it broke iSCSI and FCoE.
We fix this by making compatible changes to the doorbell address in bnx2i
and bnx2fc. For the userspace driver, we need to pass a modified CID
so that the existing userspace driver will calculate the correct doorbell
address and continue to work.
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 36 ++++++++++++++++++++--
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 4 ++
drivers/net/ethernet/broadcom/cnic.c | 3 +-
drivers/scsi/bnx2fc/bnx2fc.h | 2 +-
drivers/scsi/bnx2fc/bnx2fc_hwi.c | 3 +-
drivers/scsi/bnx2i/bnx2i.h | 2 +-
drivers/scsi/bnx2i/bnx2i_hwi.c | 3 +-
7 files changed, 43 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index 70b6a05..97b3d32 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -246,8 +246,37 @@ enum {
BNX2X_MAX_CNIC_ETH_CL_ID_IDX,
};
-#define BNX2X_CNIC_START_ETH_CID(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) *\
+/* use a value high enough to be above all the PFs, which has least significant
+ * nibble as 8, so when cnic needs to come up with a CID for UIO to use to
+ * calculate doorbell address according to old doorbell configuration scheme
+ * (db_msg_sz 1 << 7 * cid + 0x40 DPM offset) it can come up with a valid number
+ * We must avoid coming up with cid 8 for iscsi since according to this method
+ * the designated UIO cid will come out 0 and it has a special handling for that
+ * case which doesn't suit us. Therefore will will cieling to closes cid which
+ * has least signigifcant nibble 8 and if it is 8 we will move forward to 0x18.
+ */
+
+#define BNX2X_1st_NON_L2_ETH_CID(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) * \
(bp)->max_cos)
+/* amount of cids traversed by UIO's DPM addition to doorbell */
+#define UIO_DPM 8
+/* roundup to DPM offset */
+#define UIO_ROUNDUP(bp) (roundup(BNX2X_1st_NON_L2_ETH_CID(bp), \
+ UIO_DPM))
+/* offset to nearest value which has lsb nibble matching DPM */
+#define UIO_CID_OFFSET(bp) ((UIO_ROUNDUP(bp) + UIO_DPM) % \
+ (UIO_DPM * 2))
+/* add offset to rounded-up cid to get a value which could be used with UIO */
+#define UIO_DPM_ALIGN(bp) (UIO_ROUNDUP(bp) + UIO_CID_OFFSET(bp))
+/* but wait - avoid UIO special case for cid 0 */
+#define UIO_DPM_CID0_OFFSET(bp) ((UIO_DPM * 2) * \
+ (UIO_DPM_ALIGN(bp) == UIO_DPM))
+/* Properly DPM aligned CID dajusted to cid 0 secal case */
+#define BNX2X_CNIC_START_ETH_CID(bp) (UIO_DPM_ALIGN(bp) + \
+ (UIO_DPM_CID0_OFFSET(bp)))
+/* how many cids were wasted - need this value for cid allocation */
+#define UIO_CID_PAD(bp) (BNX2X_CNIC_START_ETH_CID(bp) - \
+ BNX2X_1st_NON_L2_ETH_CID(bp))
/* iSCSI L2 */
#define BNX2X_ISCSI_ETH_CID(bp) (BNX2X_CNIC_START_ETH_CID(bp))
/* FCoE L2 */
@@ -1680,10 +1709,11 @@ struct bnx2x {
* Maximum CID count that might be required by the bnx2x:
* Max RSS * Max_Tx_Multi_Cos + FCoE + iSCSI
*/
+
#define BNX2X_L2_CID_COUNT(bp) (BNX2X_NUM_ETH_QUEUES(bp) * BNX2X_MULTI_TX_COS \
- + 2 * CNIC_SUPPORT(bp))
+ + CNIC_SUPPORT(bp) * (2 + UIO_CID_PAD(bp)))
#define BNX2X_L2_MAX_CID(bp) (BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS \
- + 2 * CNIC_SUPPORT(bp))
+ + CNIC_SUPPORT(bp) * (2 + UIO_CID_PAD(bp)))
#define L2_ILT_LINES(bp) (DIV_ROUND_UP(BNX2X_L2_CID_COUNT(bp),\
ILT_PAGE_CIDS))
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 62c59ed..a6704b5 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13632,6 +13632,10 @@ void bnx2x_setup_cnic_info(struct bnx2x *bp)
cp->fcoe_init_cid = BNX2X_FCOE_ETH_CID(bp);
cp->iscsi_l2_cid = BNX2X_ISCSI_ETH_CID(bp);
+ DP(NETIF_MSG_IFUP, "BNX2X_1st_NON_L2_ETH_CID(bp) %x, cp->starting_cid %x, cp->fcoe_init_cid %x, cp->iscsi_l2_cid %x\n",
+ BNX2X_1st_NON_L2_ETH_CID(bp), cp->starting_cid, cp->fcoe_init_cid,
+ cp->iscsi_l2_cid);
+
if (NO_ISCSI_OOO(bp))
cp->drv_state |= CNIC_DRV_STATE_NO_ISCSI_OOO;
}
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 8142480..93da16b 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -5217,7 +5217,8 @@ static void cnic_init_rings(struct cnic_dev *dev)
"iSCSI CLIENT_SETUP did not complete\n");
cnic_spq_completion(dev, DRV_CTL_RET_L2_SPQ_CREDIT_CMD, 1);
cnic_ring_ctl(dev, cid, cli, 1);
- *cid_ptr = cid;
+ *cid_ptr = cid >> 4;
+ *(cid_ptr + 1) = cid * bp->db_size;
}
}
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 08b22a9..cadac9d 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -105,7 +105,7 @@
#define BNX2FC_RQ_WQE_SIZE (BNX2FC_RQ_BUF_SZ)
#define BNX2FC_XFERQ_WQE_SIZE (sizeof(struct fcoe_xfrqe))
#define BNX2FC_CONFQ_WQE_SIZE (sizeof(struct fcoe_confqe))
-#define BNX2FC_5771X_DB_PAGE_SIZE 128
+#define BNX2X_DB_SHIFT 3
#define BNX2FC_TASK_SIZE 128
#define BNX2FC_TASKS_PER_PAGE (PAGE_SIZE/BNX2FC_TASK_SIZE)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
index c0d035a..df96ee6 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
@@ -1421,8 +1421,7 @@ int bnx2fc_map_doorbell(struct bnx2fc_rport *tgt)
reg_base = pci_resource_start(hba->pcidev,
BNX2X_DOORBELL_PCI_BAR);
- reg_off = BNX2FC_5771X_DB_PAGE_SIZE *
- (context_id & 0x1FFFF) + DPM_TRIGER_TYPE;
+ reg_off = (1 << BNX2X_DB_SHIFT) * (context_id & 0x1FFFF);
tgt->ctx_base = ioremap_nocache(reg_base + reg_off, 4);
if (!tgt->ctx_base)
return -ENOMEM;
diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h
index 6940f09..742a8c6 100644
--- a/drivers/scsi/bnx2i/bnx2i.h
+++ b/drivers/scsi/bnx2i/bnx2i.h
@@ -64,7 +64,7 @@
#define MAX_PAGES_PER_CTRL_STRUCT_POOL 8
#define BNX2I_RESERVED_SLOW_PATH_CMD_SLOTS 4
-#define BNX2I_5771X_DBELL_PAGE_SIZE 128
+#define BNX2X_DB_SHIFT 3
/* 5706/08 hardware has limit on maximum buffer size per BD it can handle */
#define MAX_BD_LENGTH 65535
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index af3e675..6a6e17f 100644
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -2738,8 +2738,7 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep)
if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) {
reg_base = pci_resource_start(ep->hba->pcidev,
BNX2X_DOORBELL_PCI_BAR);
- reg_off = BNX2I_5771X_DBELL_PAGE_SIZE * (cid_num & 0x1FFFF) +
- DPM_TRIGER_TYPE;
+ reg_off = (1 << BNX2X_DB_SHIFT) * (cid_num & 0x1FFFF);
ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4);
goto arm_cq;
}
--
1.7.1
^ permalink raw reply related
* Re: [CFT][PATCH] net: Delay default_device_exit_batch until no devices are unregistering
From: Eric W. Biederman @ 2013-09-18 8:19 UTC (permalink / raw)
To: David Miller; +Cc: fruggeri, edumazet, jiri, alexander.h.duyck, amwang, netdev
In-Reply-To: <20130917.235247.344101545141336143.davem@davemloft.net>
David Miller <davem@davemloft.net> writes:
> From: Francesco Ruggeri <fruggeri@aristanetworks.com>
> Date: Tue, 17 Sep 2013 20:50:41 -0700
>> I am not sure that would work.
>> list_empty(&net_todo_list) does not guarantee that there are no
>> unregistering devices still in flight.
>> Another process may have copied net_todo_run into its local list, left
>> net_todo_list empty and still be in the middle of processing
>> unregistering devices (without the rtnl lock) when
>> default_device_exit_batch starts executing.
>
> Ok, now I understand.
>
> Eric B., when you get a chance can you resubmit your patch and perhaps
> elaborate on the situation in the commit message.
The code is on my computer at home so I won't be able to get back to
this until Sunday or Monday. This should give Francesco time to verify
I really have closed the holes he is seeing.
> If I was confused I'm sure other people will be if they look into
> this in the future.
Agreed. It is easy to get confused with this issue. And I was in a
rush so I expect my wording could be improved.
There is still the other part of this issue that dev_close reorders
devices in default_device_exit_batch.
With that reordering we can get the call chain:
netdev_run_todo
call_netdevice_notifiers(NETDEV_UNREGISTER_FINAL,...)
dst_dev_event
dst_ifdown(..., unregister == 1)
dst->dev = dev_net(dst->dev)->loopback_dev;
dev_hold(dst->dev);
With dev_net(dst->dev)->loopback_dev == NULL;
So my patch to split the close_list out of the unreg_list is also needed
(or something else to address that issue).
Hopefully my exaspearation with dev_close_many didn't obscure what is
happening there.
Eric
^ permalink raw reply
* Re: [PATCH net-next v2 1/2] ipv4: IP_TOS and IP_TTL can be specified as ancillary data
From: Francesco Fusco @ 2013-09-18 8:16 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20130917.204648.339747836268253489.davem@davemloft.net>
Thanks David.
I will resubmit the patches as they are as soon as the merge window
opens again.
Best,
Francesco
On 09/18/2013 02:46 AM, David Miller wrote:
> From: Francesco Fusco <ffusco@redhat.com>
> Date: Wed, 28 Aug 2013 09:56:32 +0200
>
>> On 08/27/2013 08:56 PM, David Miller wrote:
>>> From: Francesco Fusco <ffusco@redhat.com>
>>> Date: Fri, 23 Aug 2013 14:19:32 +0200
>>>
>>>> - changed the icmp_cookie ttl field from __s16 to __u8.
>>>> A value of 0 means that the TTL has not been specified
>>>
>>> Sorry, I have to ask you to change the ttl field type back to __s16
>>> and use "-1" to mean not-specified.
>>>
>>> Zero is a valid TTL setting and it means to not allow the
>>> packet to leave this host.
>>
>> Actually setsockopt() does not allow a TTL value of zero:
>>
>> From net/ipv4/ip_sockglue.c::do_ip_setsockopt()
>
> Indeed, you are right.
>
> Please resubmit these patches for the next merge window.
>
> Thank you.
>
^ permalink raw reply
* the meaning of "shaper" in the changelog of commit baafc77b32f64
From: Duan Jiong @ 2013-09-18 7:24 UTC (permalink / raw)
To: saurabh; +Cc: netdev
Hi,
Now i'm reproducing the bug you found in commit
baafc77b32f64("net/ipv4: ip_vti clear skb cb before tunneling"),
and i don't know the meaning of "shaper" in the changelog. can you
explain it?
Thanks,
Duan
^ permalink raw reply
* Re: [RFC PATCH v2 net-next 0/2] BPF and OVS extensions
From: Alexei Starovoitov @ 2013-09-18 6:58 UTC (permalink / raw)
To: David Laight
Cc: David S. Miller, netdev, Eric Dumazet, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin, Daniel Borkmann, Paul E. McKenney,
Xi Wang, David Howells, Cong Wang, Jesse Gross, Pravin B Shelar,
Ben Pfaff, Thomas Graf, dev
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B733F@saturn3.aculab.com>
On Tue, Sep 17, 2013 at 1:40 AM, David Laight <David.Laight@aculab.com> wrote:
>
> > Patch 1/2: generic BPF extension
> > Original A and X 32-bit BPF registers are replaced with ten 64-bit registers.
> > bpf opcode encoding kept the same. load/store were generalized to access stack,
> > bpf_tables and bpf_context.
> > BPF program interfaces to outside world via tables that it can read and write,
> > and via bpf_context which is in/out blob of data.
> > Other kernel components can provide callbacks to tailor BPF to specific needs.
>
> As has been recently pointed out on some of the NetBSD lists
> one of the points about BPF is that the filters are deterministic
> and easily proven to both terminate and have no unwanted side effects.
>
> The functionality you are proposing breaks both of these assumptions.
Proposed BPF extensions keep both of these assumptions. See bpf_check.c
It guarantees that BPF program terminates, all memory/register
accesses are valid,
function arguments are verified, no unknown insns, register/stack is initialized
before read, aligned, etc
BPF checker algorithm is not as trivial as it was before, but still
straightforward and simple.
It helped us catch some interesting bugs in BPF GCC backend. In one
case we miscalculated
branch target by one insn and since register read came before it was
written, BPF checker caught it.
In another case we improperly coded branch conditions in cbranchdi4
(see gcc/config/bpf/bpf.md on github). Again it caught it.
Using compiler is not mandatory. One can code BPF in assembler in the
same way it was done before,
but doing it in C is easier to understand.
Thanks
Alexei
^ permalink raw reply
* Re: mvneta: oops in __rcu_read_lock on mirabox
From: Ethan Tuttle @ 2013-09-18 6:30 UTC (permalink / raw)
To: Willy Tarreau
Cc: Russell King - ARM Linux, Thomas Petazzoni, Andrew Lunn,
Jason Cooper, netdev, Ezequiel Garcia, Gregory Clément,
linux-arm-kernel
In-Reply-To: <20130917060111.GB9325@1wt.eu>
On Mon, Sep 16, 2013 at 11:01 PM, Willy Tarreau <w@1wt.eu> wrote:
> Next step should be that you test both kernels to be sure.
Thanks for the kernel images, Willy. I'm still experimenting but
initial results are strange: I haven't seen a crash from the -ethan
image you provided, nor by a kernel with that config that I built
myself. The config is only different from my crashing config by a few
options. So perhaps some combination of options prevents the crash.
I'll see if I can narrow it down.
For a moment I thought I found a likely culprit: all along I've been
loading my kernel in to 0x02000000 in uboot, while the stock uboot env
(and Willy) uses 0x6400000. But I've seen at least one
__rcu_read_lock oops since switching to 0x6400000. So I guess I can
rule that out.
Thanks,
Ethan
^ permalink raw reply
* [PATCH] batman-adv: set the TAG flag for the vid passed to BLA
From: Antonio Quartulli @ 2013-09-18 6:27 UTC (permalink / raw)
To: davem
Cc: netdev, b.a.t.m.a.n, Antonio Quartulli, Antonio Quartulli,
Marek Lindner
In-Reply-To: <1379485658-2317-1-git-send-email-ordex@autistici.org>
From: Antonio Quartulli <antonio@open-mesh.com>
When receiving or sending a packet a packet on a VLAN, the
vid has to be marked with the TAG flag in order to make any
component in batman-adv understand that the packet is coming
from a really tagged network.
This fix the Bridge Loop Avoidance behaviour which was not
able to send announces over VLAN interfaces.
Introduced by 0b1da1765fdb00ca5d53bc95c9abc70dfc9aae5b
("batman-adv: change VID semantic in the BLA code")
Signed-off-by: Antonio Quartulli <antonio@open-mesh.org>
Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
net/batman-adv/soft-interface.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 4493913..813db4e 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -168,6 +168,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
case ETH_P_8021Q:
vhdr = (struct vlan_ethhdr *)skb->data;
vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK;
+ vid |= BATADV_VLAN_HAS_TAG;
if (vhdr->h_vlan_encapsulated_proto != ethertype)
break;
@@ -331,6 +332,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
case ETH_P_8021Q:
vhdr = (struct vlan_ethhdr *)skb->data;
vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK;
+ vid |= BATADV_VLAN_HAS_TAG;
if (vhdr->h_vlan_encapsulated_proto != ethertype)
break;
--
1.8.1.5
^ permalink raw reply related
* pull request net: batman-adv 2013-09-18
From: Antonio Quartulli @ 2013-09-18 6:27 UTC (permalink / raw)
To: davem; +Cc: netdev, b.a.t.m.a.n
Hello David,
this is a very small (but important) fix intended for net/linux-3.{11,12} (since
3.12-rc1 is out I guess this patch needs to be enqueued for stable in order to
reach 3.11?)
This change fixes a regression introduced in 3.11 that prevents the Bridge Loop
Avoidance component from correctly operate on VLANs.
Please pull or let me know of any problem.
Thank you,
Antonio
The following changes since commit 1ef68ec462571955f2a667ddf1ffe279848709d7:
Merge branch 'sfc-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc (2013-09-16 21:43:54 -0400)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem
for you to fetch changes up to 4c18c425b2d228415b635e97a64737d7f27c5536:
batman-adv: set the TAG flag for the vid passed to BLA (2013-09-17 21:15:16 +0200)
----------------------------------------------------------------
Included change:
- fix the Bridge Loop Avoidance component by marking the variables containing
the VLAN ID with the HAS_TAG flag when needed.
----------------------------------------------------------------
Antonio Quartulli (1):
batman-adv: set the TAG flag for the vid passed to BLA
net/batman-adv/soft-interface.c | 2 ++
1 file changed, 2 insertions(+)
^ permalink raw reply
* 答复: [PATCH net-next] gen_estimator: change the lock order for better perfermance(Internet mail)
From: zhiguohong(洪志国) @ 2013-09-18 5:41 UTC (permalink / raw)
To: Eric Dumazet, Hong Zhiguo
Cc: netdev@vger.kernel.org, davem@davemloft.net,
stephen@networkplumber.org
In-Reply-To: <1379416308.29845.11.camel@edumazet-glaptop>
Actually I did try LOCKDEP and didn't get any warning.
Could you pointed out why it's wrong?
-----邮件原件-----
发件人: Eric Dumazet [mailto:eric.dumazet@gmail.com]
发送时间: 2013年9月17日 19:12
收件人: Hong Zhiguo
抄送: netdev@vger.kernel.org; davem@davemloft.net; stephen@networkplumber.org; zhiguohong(洪志国)
主题: Re: [PATCH net-next] gen_estimator: change the lock order for better perfermance(Internet mail)
On Tue, 2013-09-17 at 16:38 +0800, Hong Zhiguo wrote:
> From: Hong Zhiguo <zhiguohong@tencent.com>
>
> e->stats_lock is usually taken by fast path to update stats.
> In the old order, fast path should wait for write_lock(&est_lock).
> Even though it's only one line inside the write_lock(&est_lock), but
> if there's interrupt or page fault, a lot of spin on
> e->stats_lock will be wasted in fast path.
1) net-next is not open
2) There is no way a page fault can happen in this path.
3) This patch is wrong.
Current order is there for good reasons.
Have you really tried LOCKDEP, before sending a patch changing lock order ?
^ permalink raw reply
* Re: [RFC PATCHv2 3/4] of: provide a binding for fixed link PHYs
From: Grant Likely @ 2013-09-18 4:29 UTC (permalink / raw)
To: Thomas Petazzoni, David S. Miller, netdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: Lior Amsalem, Mark Rutland, Sascha Hauer, Christian Gmeiner,
Ezequiel Garcia, Gregory Clement, Florian Fainelli,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <1378480701-12908-4-git-send-email-thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
On Fri, 6 Sep 2013 17:18:20 +0200, Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
> Some Ethernet MACs have a "fixed link", and are not connected to a
> normal MDIO-managed PHY device. For those situations, a Device Tree
> binding allows to describe a "fixed link" using a special PHY node.
>
> This patch adds:
>
> * A documentation for the fixed PHY Device Tree binding.
>
> * An of_phy_is_fixed_link() function that an Ethernet driver can call
> on its PHY phandle to find out whether it's a fixed link PHY or
> not. It should typically be used to know if
> of_phy_register_fixed_link() should be called.
>
> * An of_phy_register_fixed_link() function that instantiates the
> fixed PHY into the PHY subsystem, so that when the driver calls
> of_phy_connect(), the PHY device associated to the OF node will be
> found.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Hi Thomas,
The implemenation in this series looks like it is in good shape, so I'll
restrict my comments to be binding...
> ---
> .../devicetree/bindings/net/fixed-link.txt | 34 ++++++++++++++++++++++
> drivers/of/of_mdio.c | 24 +++++++++++++++
> include/linux/of_mdio.h | 15 ++++++++++
> 3 files changed, 73 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/fixed-link.txt
>
> diff --git a/Documentation/devicetree/bindings/net/fixed-link.txt b/Documentation/devicetree/bindings/net/fixed-link.txt
> new file mode 100644
> index 0000000..9f2a1a50
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/fixed-link.txt
> @@ -0,0 +1,34 @@
> +Fixed link Device Tree binding
> +------------------------------
> +
> +Some Ethernet MACs have a "fixed link", and are not connected to a
> +normal MDIO-managed PHY device. For those situations, a Device Tree
> +binding allows to describe a "fixed link".
> +
> +Such a fixed link situation is described by creating a PHY node as a
> +sub-node of an Ethernet device, with the following properties:
> +
> +* 'fixed-link' (boolean, mandatory), to indicate that this PHY is a
> + fixed link PHY.
> +* 'speed' (integer, mandatory), to indicate the link speed. Accepted
> + values are 10, 100 and 1000
> +* 'full-duplex' (boolean, optional), to indicate that full duplex is
> + used. When absent, half duplex is assumed.
> +* 'pause' (boolean, optional), to indicate that pause should be
> + enabled.
> +* 'asym-pause' (boolean, optional), to indicate that asym_pause should
> + be enabled.
I understand what you're trying to do here, but it causes a troublesome
leakage of implementation detail into the binding, making the whole
thing look very odd. This binding tries to make a fixed link look
exactly like a real PHY even to the point of including a phandle to the
phy. But having a phandle to a node which is *always* a direct child of
the MAC node is redundant and a rather looney. Yes, doing it that way
makes it easy for of_phy_find_device() to be transparent for fixed link,
but that should *not* drive bindings, especially when that makes the
binding really rather weird.
Second, this new binding doesn't provide anything over and above the
existing fixed-link binding. It may not be pretty, but it is
estabilshed.
That said, I do agree that the current Linux implementation is not good
because it cannot handle a fixed-link property transparently. That's a
deficiency in the Linux implementation and it should be fixed.
of_phy_connect() currently requires the phy phandle to be passed in.
Part of the reason it was done this way is that some drivers connect to
multiple 'phys'. A soulition could be to make the phy handle optional.
If it is empty then go looking for either a phy-device or fixed-link
property. Otherwise use the provided node.
g.
> +
> +Example:
> +
> +ethernet@0 {
> + ...
> + phy = <&phy0>;
> + phy0: phy@0 {
> + fixed-link;
> + speed = <1000>;
> + full-duplex;
> + };
> + ...
> +};
> +
> diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
> index d5a57a9..0507f8f 100644
> --- a/drivers/of/of_mdio.c
> +++ b/drivers/of/of_mdio.c
> @@ -14,6 +14,7 @@
> #include <linux/netdevice.h>
> #include <linux/err.h>
> #include <linux/phy.h>
> +#include <linux/phy_fixed.h>
> #include <linux/of.h>
> #include <linux/of_irq.h>
> #include <linux/of_mdio.h>
> @@ -247,3 +248,26 @@ struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
> return IS_ERR(phy) ? NULL : phy;
> }
> EXPORT_SYMBOL(of_phy_connect_fixed_link);
> +
> +#if defined(CONFIG_FIXED_PHY)
> +bool of_phy_is_fixed_link(struct device_node *np)
> +{
> + return of_property_read_bool(np, "fixed-link");
> +}
> +EXPORT_SYMBOL(of_phy_is_fixed_link);
> +
> +int of_phy_register_fixed_link(struct device_node *np)
> +{
> + struct fixed_phy_status status = {};
> +
> + status.link = 1;
> + status.duplex = of_property_read_bool(np, "full-duplex");
> + if (of_property_read_u32(np, "speed", &status.speed))
> + return -EINVAL;
> + status.pause = of_property_read_bool(np, "pause");
> + status.asym_pause = of_property_read_bool(np, "asym-pause");
> +
> + return fixed_phy_register(PHY_POLL, &status, np);
> +}
> +EXPORT_SYMBOL(of_phy_register_fixed_link);
> +#endif
> diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
> index 8163107..2f535ee 100644
> --- a/include/linux/of_mdio.h
> +++ b/include/linux/of_mdio.h
> @@ -57,4 +57,19 @@ static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
> }
> #endif /* CONFIG_OF */
>
> +#if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY)
> +extern int of_phy_register_fixed_link(struct device_node *np);
> +extern bool of_phy_is_fixed_link(struct device_node *np);
> +#else
> +static inline int of_phy_register_fixed_link(struct device_node *np)
> +{
> + return -ENOSYS;
> +}
> +static inline bool of_phy_is_fixed_link(struct device_node *np)
> +{
> + return false;
> +}
> +#endif
> +
> +
> #endif /* __LINUX_OF_MDIO_H */
> --
> 1.8.1.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v2 6/6] ipv6: Do route updating for redirect in ndisc layer
From: Hannes Frederic Sowa @ 2013-09-18 4:13 UTC (permalink / raw)
To: Duan Jiong; +Cc: David Miller, netdev
In-Reply-To: <5239076A.4080406@cn.fujitsu.com>
On Wed, Sep 18, 2013 at 09:52:42AM +0800, Duan Jiong wrote:
> 于 2013年09月18日 09:39, Hannes Frederic Sowa 写道:
> > On Tue, Sep 17, 2013 at 08:29:36PM -0400, David Miller wrote:
> >> From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> >> Date: Fri, 13 Sep 2013 11:03:07 +0800
> >>
> >>> From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> >>>
> >>> Do the whole verification and route updating in ndisc
> >>> lay and then just call into icmpv6_notify() to notify
> >>> the upper protocols.
> >>>
> >>> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> >>
> >> This is completely broken, and I believe your patch set fundamentally
> >> is too.
> >>
> >> We absolutely _must_ handle the redirect at the socket level when
> >> we are able to, otherwise we cannot specify the mark properly and
> >> the mark is an essential part of the key used to find the correct
> >> route to work with.
> >>
> >> I am not applying this patch series until you deal with this
> >> deficiency. I am not willing to consider changes which stop using the
> >> more precise keying information available from a socket.
> >
> > Oh, Duan, I am very sorry for not catching this earlier. We use the
> > sk->mark to select the proper routing table where we clone the rt6_info into.
> > And we only get that value out of the sockets. I missed that. We should leave
> > the redirect logic in the socket layer where it is possible.
> >
> > But parts of this series are still valid. We need to fix redirects for tunnels
> > and I do think we can still simplify some code in the error handlers.
> >
>
> I got it.
I gave it a bit more thought:
RFC 4861 8.3:
"
Redirect messages apply to all flows that are being sent to a given
destination. That is, upon receipt of a Redirect for a Destination
Address, all Destination Cache entries to that address should be
updated to use the specified next-hop, regardless of the contents of
the Flow Label field that appears in the Redirected Header option.
"
Especially because redirects also help in the on-link determination (same
RFC, section 8), I changed my mind and am still in favour of updating it
in the ndisc layer. In my opinion we just have to consider all routing
tables and apply the update to every one which carries a valid next hop
to the source of the redirect (under consideration of the destination).
This will be important if we actually try to get linux to correctly
implement the ipv6 subnet model (RFC 5942, Section 4 Rule 1). In that
case we are not allowed to assume nodes on-link even if they would match
the same prefix as a locally configured address.
Greetings,
Hannes
^ permalink raw reply
* Re: [CFT][PATCH] net: Delay default_device_exit_batch until no devices are unregistering
From: David Miller @ 2013-09-18 3:52 UTC (permalink / raw)
To: fruggeri; +Cc: ebiederm, edumazet, jiri, alexander.h.duyck, amwang, netdev
In-Reply-To: <CA+HUmGgg3-0UNgfKS6Hpnczzi6PUeztk8TZ7p_97kcvtfMacJQ@mail.gmail.com>
From: Francesco Ruggeri <fruggeri@aristanetworks.com>
Date: Tue, 17 Sep 2013 20:50:41 -0700
>>> List/count I don't much care but currently we don't have a list of
>>> all of the devices that are unregistering.
>>>
>>> The problem with this is that netdev_run_todo moves all of the
>>> devices to a local list, so they are only visible from a list_head
>>> on the stack. Which makes sense as we run this all in the context
>>> of rtnl_unlock.
>>
>> And when that local list is processed (the while loop completes and
>> has iterated over the entire list), either the global todo list is
>> empty, or it is not empty.
>>
>> And the waked up code will check for this.
>>
>> I really don't see what the problem is.
>
> I am not sure that would work.
> list_empty(&net_todo_list) does not guarantee that there are no
> unregistering devices still in flight.
> Another process may have copied net_todo_run into its local list, left
> net_todo_list empty and still be in the middle of processing
> unregistering devices (without the rtnl lock) when
> default_device_exit_batch starts executing.
Ok, now I understand.
Eric B., when you get a chance can you resubmit your patch and perhaps
elaborate on the situation in the commit message.
If I was confused I'm sure other people will be if they look into
this in the future.
^ permalink raw reply
* Re: [CFT][PATCH] net: Delay default_device_exit_batch until no devices are unregistering
From: Francesco Ruggeri @ 2013-09-18 3:50 UTC (permalink / raw)
To: David Miller
Cc: Eric W. Biederman, Eric Dumazet, Jiří Pírko,
Alexander Duyck, Cong Wang, netdev
In-Reply-To: <20130917.201515.1404443973169590392.davem@davemloft.net>
>> List/count I don't much care but currently we don't have a list of
>> all of the devices that are unregistering.
>>
>> The problem with this is that netdev_run_todo moves all of the
>> devices to a local list, so they are only visible from a list_head
>> on the stack. Which makes sense as we run this all in the context
>> of rtnl_unlock.
>
> And when that local list is processed (the while loop completes and
> has iterated over the entire list), either the global todo list is
> empty, or it is not empty.
>
> And the waked up code will check for this.
>
> I really don't see what the problem is.
I am not sure that would work.
list_empty(&net_todo_list) does not guarantee that there are no
unregistering devices still in flight.
Another process may have copied net_todo_run into its local list, left
net_todo_list empty and still be in the middle of processing
unregistering devices (without the rtnl lock) when
default_device_exit_batch starts executing.
> The count doesn't necessarily need to be atomic as it can be protected
> by the rtnl_lock.
If we use the rtnl_lock then we could have per-net wait queues. While
not strictly needed (since only one instance of
default_device_exit_batch can execute at a time) it would avoid
unnecessarily waking up the waiting code.
Francesco
^ permalink raw reply
* [PATCH Resend 3/3] net: cxgb4vf: Staticize local symbols
From: Sachin Kamat @ 2013-09-18 3:30 UTC (permalink / raw)
To: netdev; +Cc: davem, sachin.kamat, Casey Leedom
In-Reply-To: <1379475001-24505-1-git-send-email-sachin.kamat@linaro.org>
Local symbols used only in this file are made static.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Casey Leedom <leedom@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4vf/sge.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
index df296af..8475c4c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
@@ -1396,8 +1396,9 @@ static inline void copy_frags(struct sk_buff *skb,
* Builds an sk_buff from the given packet gather list. Returns the
* sk_buff or %NULL if sk_buff allocation failed.
*/
-struct sk_buff *t4vf_pktgl_to_skb(const struct pkt_gl *gl,
- unsigned int skb_len, unsigned int pull_len)
+static struct sk_buff *t4vf_pktgl_to_skb(const struct pkt_gl *gl,
+ unsigned int skb_len,
+ unsigned int pull_len)
{
struct sk_buff *skb;
@@ -1443,7 +1444,7 @@ out:
* Releases the pages of a packet gather list. We do not own the last
* page on the list and do not free it.
*/
-void t4vf_pktgl_free(const struct pkt_gl *gl)
+static void t4vf_pktgl_free(const struct pkt_gl *gl)
{
int frag;
@@ -1640,7 +1641,7 @@ static inline void rspq_next(struct sge_rspq *rspq)
* on this queue. If the system is under memory shortage use a fairly
* long delay to help recovery.
*/
-int process_responses(struct sge_rspq *rspq, int budget)
+static int process_responses(struct sge_rspq *rspq, int budget)
{
struct sge_eth_rxq *rxq = container_of(rspq, struct sge_eth_rxq, rspq);
int budget_left = budget;
@@ -1893,7 +1894,7 @@ static unsigned int process_intrq(struct adapter *adapter)
* The MSI interrupt handler handles data events from SGE response queues as
* well as error and other async events as they all use the same MSI vector.
*/
-irqreturn_t t4vf_intr_msi(int irq, void *cookie)
+static irqreturn_t t4vf_intr_msi(int irq, void *cookie)
{
struct adapter *adapter = cookie;
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 2/3] net: bnx2x: Staticize local symbols
From: Sachin Kamat @ 2013-09-18 3:30 UTC (permalink / raw)
To: netdev; +Cc: davem, sachin.kamat, Eilon Greenstein, Ariel Elior
In-Reply-To: <1379475001-24505-1-git-send-email-sachin.kamat@linaro.org>
Local symbols used only in this file are made static.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: Ariel Elior <ariele@broadcom.com>
---
Changes since v1:
Changed the coding style as suggested by Ariel Elior.
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 2604b62..7991f10 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -2802,7 +2802,7 @@ struct set_vf_state_cookie {
u8 state;
};
-void bnx2x_set_vf_state(void *cookie)
+static void bnx2x_set_vf_state(void *cookie)
{
struct set_vf_state_cookie *p = (struct set_vf_state_cookie *)cookie;
@@ -3222,8 +3222,9 @@ void bnx2x_disable_sriov(struct bnx2x *bp)
pci_disable_sriov(bp->pdev);
}
-int bnx2x_vf_ndo_prep(struct bnx2x *bp, int vfidx, struct bnx2x_virtf **vf,
- struct pf_vf_bulletin_content **bulletin)
+static int bnx2x_vf_ndo_prep(struct bnx2x *bp, int vfidx,
+ struct bnx2x_virtf **vf,
+ struct pf_vf_bulletin_content **bulletin)
{
if (bp->state != BNX2X_STATE_OPEN) {
BNX2X_ERR("vf ndo called though PF is down\n");
--
1.7.9.5
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox