/* * This file is part of the Chelsio T4 PCI-E SR-IOV Virtual Function Ethernet * driver for Linux. * * Copyright (c) 2009-2010 Chelsio Communications, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE.
*/
/* All T4 and later chips have their PCI-E Device IDs encoded as 0xVFPP where: * * V = "4" for T4; "5" for T5, etc. or * = "a" for T4 FPGA; "b" for T4 FPGA, etc. * F = "0" for PF 0..3; "4".."7" for PF4..7; and "8" for VFs * PP = adapter product designation
*/ #define CHELSIO_T4 0x4 #define CHELSIO_T5 0x5 #define CHELSIO_T6 0x6
/* * Per-"port" (Virtual Interface) link configuration ...
*/ typedef u16 fw_port_cap16_t; /* 16-bit Port Capabilities integral value */ typedef u32 fw_port_cap32_t; /* 32-bit Port Capabilities integral value */
enum fw_caps {
FW_CAPS_UNKNOWN = 0, /* 0'ed out initial state */
FW_CAPS16 = 1, /* old Firmware: 16-bit Port Capabilities */
FW_CAPS32 = 2, /* new Firmware: 32-bit Port Capabilities */
};
fw_port_cap32_t speed_caps; /* speed(s) user has requested */
u32 speed; /* actual link speed */
enum cc_pause requested_fc; /* flow control user has requested */ enum cc_pause fc; /* actual link flow control */ enum cc_pause advertised_fc; /* actual advertised flow control */
enum cc_fec auto_fec; /* Forward Error Correction: */ enum cc_fec requested_fec; /* "automatic" (IEEE 802.3), */ enum cc_fec fec; /* requested, and actual in use */
unsignedchar autoneg; /* autonegotiating? */
unsignedchar link_ok; /* link up? */ unsignedchar link_down_rc; /* link down reason */
};
/* Return true if the Link Configuration supports "High Speeds" (those greater * than 1Gb/s).
*/ staticinlinebool is_x_10g_port(conststruct link_config *lc)
{
fw_port_cap32_t speeds, high_speeds;
/* Firmware Mailbox Command/Reply log. All values are in Host-Endian format. * The access and execute times are signed in order to accommodate negative * error returns.
*/ struct mbox_cmd {
u64 cmd[MBOX_LEN / 8]; /* a Firmware Mailbox Command/Reply */
u64 timestamp; /* OS-dependent timestamp */
u32 seqno; /* sequence number */
s16 access; /* time (ms) to access mailbox */
s16 execute; /* time (ms) to execute */
};
struct mbox_cmd_log { unsignedint size; /* number of entries in the log */ unsignedint cursor; /* next position in the log to write */
u32 seqno; /* next sequence number */ /* variable length mailbox command log starts here */
};
/* Given a pointer to a Firmware Mailbox Command Log and a log entry index, * return a pointer to the specified entry.
*/ staticinlinestruct mbox_cmd *mbox_cmd_log_entry(struct mbox_cmd_log *log, unsignedint entry_idx)
{ return &((struct mbox_cmd *)&(log)[1])[entry_idx];
}
/** * hash_mac_addr - return the hash value of a MAC address * @addr: the 48-bit Ethernet MAC address * * Hashes a MAC address according to the hash function used by hardware * inexact (hash) address matching.
*/ staticinlineint hash_mac_addr(const u8 *addr)
{
u32 a = ((u32)addr[0] << 16) | ((u32)addr[1] << 8) | addr[2];
u32 b = ((u32)addr[3] << 16) | ((u32)addr[4] << 8) | addr[5];
a ^= b;
a ^= (a >> 12);
a ^= (a >> 6); return a & 0x3f;
}
int t4vf_wait_dev_ready(struct adapter *); int t4vf_port_init(struct adapter *, int);
int t4vf_fw_reset(struct adapter *); int t4vf_set_params(struct adapter *, unsignedint, const u32 *, const u32 *);
unsignedint t4vf_get_pf_from_vf(struct adapter *); int t4vf_get_sge_params(struct adapter *); int t4vf_get_vpd_params(struct adapter *); int t4vf_get_dev_params(struct adapter *); int t4vf_get_rss_glb_config(struct adapter *); int t4vf_get_vfres(struct adapter *);
int t4vf_read_rss_vi_config(struct adapter *, unsignedint, union rss_vi_config *); int t4vf_write_rss_vi_config(struct adapter *, unsignedint, union rss_vi_config *); int t4vf_config_rss_range(struct adapter *, unsignedint, int, int, const u16 *, int);
int t4vf_alloc_vi(struct adapter *, int); int t4vf_free_vi(struct adapter *, int); int t4vf_enable_vi(struct adapter *adapter, unsignedint viid, bool rx_en, bool tx_en); int t4vf_enable_pi(struct adapter *adapter, struct port_info *pi, bool rx_en, bool tx_en); int t4vf_identify_port(struct adapter *, unsignedint, unsignedint);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.