Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixgbe/ixgbe_osdep.c
/****************************************************************************** | /****************************************************************************** | ||||
Copyright (c) 2001-2015, Intel Corporation | Copyright (c) 2001-2016, Intel Corporation | ||||
All rights reserved. | All rights reserved. | ||||
Redistribution and use in source and binary forms, with or without | Redistribution and use in source and binary forms, with or without | ||||
modification, are permitted provided that the following conditions are met: | modification, are permitted provided that the following conditions are met: | ||||
1. Redistributions of source code must retain the above copyright notice, | 1. Redistributions of source code must retain the above copyright notice, | ||||
this list of conditions and the following disclaimer. | this list of conditions and the following disclaimer. | ||||
Show All 27 Lines | |||||
ixgbe_dev_from_hw(struct ixgbe_hw *hw) | ixgbe_dev_from_hw(struct ixgbe_hw *hw) | ||||
{ | { | ||||
return ((struct adapter *)hw->back)->dev; | return ((struct adapter *)hw->back)->dev; | ||||
} | } | ||||
inline u16 | inline u16 | ||||
ixgbe_read_pci_cfg(struct ixgbe_hw *hw, u32 reg) | ixgbe_read_pci_cfg(struct ixgbe_hw *hw, u32 reg) | ||||
{ | { | ||||
return pci_read_config(((struct adapter *)hw->back)->dev, | return pci_read_config(((struct adapter *)hw->back)->dev, reg, 2); | ||||
reg, 2); | |||||
} | } | ||||
inline void | inline void | ||||
ixgbe_write_pci_cfg(struct ixgbe_hw *hw, u32 reg, u16 value) | ixgbe_write_pci_cfg(struct ixgbe_hw *hw, u32 reg, u16 value) | ||||
{ | { | ||||
pci_write_config(((struct adapter *)hw->back)->dev, | pci_write_config(((struct adapter *)hw->back)->dev, reg, value, 2); | ||||
reg, value, 2); | |||||
} | } | ||||
inline u32 | inline u32 | ||||
ixgbe_read_reg(struct ixgbe_hw *hw, u32 reg) | ixgbe_read_reg(struct ixgbe_hw *hw, u32 reg) | ||||
{ | { | ||||
return bus_space_read_4(((struct adapter *)hw->back)->osdep.mem_bus_space_tag, | return bus_space_read_4(((struct adapter *)hw->back)->osdep.mem_bus_space_tag, | ||||
((struct adapter *)hw->back)->osdep.mem_bus_space_handle, | ((struct adapter *)hw->back)->osdep.mem_bus_space_handle, | ||||
reg); | reg); | ||||
Show All 25 Lines |