示例#1
0
static void
netxen_nic_get_pauseparam(struct net_device *dev,
			  struct ethtool_pauseparam *pause)
{
	struct netxen_adapter *adapter = netdev_priv(dev);
	__u32 val;
	int port = adapter->physical_port;

	if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
		if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
			return;
		/* get flow control settings */
		netxen_nic_read_w0(adapter,NETXEN_NIU_GB_MAC_CONFIG_0(port),
				&val);
		pause->rx_pause = netxen_gb_get_rx_flowctl(val);
		netxen_nic_read_w0(adapter, NETXEN_NIU_GB_PAUSE_CTL, &val);
		switch (port) {
			case 0:
				pause->tx_pause = !(netxen_gb_get_gb0_mask(val));
				break;
			case 1:
				pause->tx_pause = !(netxen_gb_get_gb1_mask(val));
				break;
			case 2:
				pause->tx_pause = !(netxen_gb_get_gb2_mask(val));
				break;
			case 3:
			default:
				pause->tx_pause = !(netxen_gb_get_gb3_mask(val));
				break;
		}
	} else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) {
		if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS))
			return;
		pause->rx_pause = 1;
		netxen_nic_read_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, &val);
		if (port == 0)
			pause->tx_pause = !(netxen_xg_get_xg0_mask(val));
		else
			pause->tx_pause = !(netxen_xg_get_xg1_mask(val));
	} else {
		printk(KERN_ERR"%s: Unknown board type: %x\n",
				netxen_nic_driver_name, adapter->ahw.board_type);
	}
}
示例#2
0
static void
netxen_nic_get_pauseparam(struct net_device *dev,
			  struct ethtool_pauseparam *pause)
{
	struct netxen_port *port = netdev_priv(dev);
	struct netxen_adapter *adapter = port->adapter;
	__u32 val;

	if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
		/* get flow control settings */
		netxen_nic_read_w0(adapter,
				   NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum),
				   &val);
		pause->rx_pause = netxen_gb_get_rx_flowctl(val);
		pause->tx_pause = netxen_gb_get_tx_flowctl(val);
		/* get autoneg settings */
		pause->autoneg = port->link_autoneg;
	}
}