Skip to content

Commit

Permalink
Merge pull request #25 from AVnu/open-avb-next
Browse files Browse the repository at this point in the history
Open avb next
  • Loading branch information
jfornal authored Mar 22, 2018
2 parents 955a036 + 31e8e11 commit ea7b51c
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ install:
- curl -L "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip" -o ninja-linux.zip
- sudo unzip ninja-linux.zip -d /usr/local/bin
- sudo chmod 755 /usr/local/bin/ninja
- sudo pip3 install meson
- sudo pip3 install meson==0.44.0
- curl -L "https://cmocka.org/files/1.1/cmocka-1.1.1.tar.xz" -o cmocka-1.1.1.tar.xz
- tar -xf cmocka-1.1.1.tar.xz
- pushd cmocka-1.1.1
Expand Down
1 change: 1 addition & 0 deletions kmod/igb/e1000_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
case E1000_DEV_ID_I210_FIBER:
case E1000_DEV_ID_I210_SERDES:
case E1000_DEV_ID_I210_SGMII:
case E1000_DEV_ID_I210_AUTOMOTIVE:
mac->type = e1000_i210;
break;
case E1000_DEV_ID_I211_COPPER:
Expand Down
1 change: 1 addition & 0 deletions kmod/igb/e1000_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ struct e1000_hw;
#define E1000_DEV_ID_I210_FIBER 0x1536
#define E1000_DEV_ID_I210_SERDES 0x1537
#define E1000_DEV_ID_I210_SGMII 0x1538
#define E1000_DEV_ID_I210_AUTOMOTIVE 0x15F6
#define E1000_DEV_ID_I210_COPPER_FLASHLESS 0x157B
#define E1000_DEV_ID_I210_SERDES_FLASHLESS 0x157C
#define E1000_DEV_ID_I211_COPPER 0x1539
Expand Down
2 changes: 1 addition & 1 deletion kmod/igb/e1000_osdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct e1000_hw;
/* write operations, indexed using DWORDS */
#define E1000_WRITE_REG(hw, reg, val) \
do { \
u8 __iomem *hw_addr = ACCESS_ONCE((hw)->hw_addr); \
u8 __iomem *hw_addr = READ_ONCE((hw)->hw_addr); \
if (!E1000_REMOVED(hw_addr)) \
writel((val), &hw_addr[(reg)]); \
} while (0)
Expand Down
57 changes: 52 additions & 5 deletions kmod/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ static const struct pci_device_id igb_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_FIBER) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SERDES) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SGMII) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_AUTOMOTIVE) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_COPPER_FLASHLESS) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SERDES_FLASHLESS) },
/* required last entry */
Expand All @@ -121,11 +122,17 @@ static void igb_clean_all_tx_rings(struct igb_adapter *);
static void igb_clean_all_rx_rings(struct igb_adapter *);
static void igb_clean_tx_ring(struct igb_ring *);
static void igb_set_rx_mode(struct net_device *);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
static void igb_update_phy_info(struct timer_list *);
static void igb_watchdog(struct timer_list *);
static void igb_dma_err_timer(struct timer_list *);
#else
static void igb_update_phy_info(unsigned long);
static void igb_watchdog(unsigned long);
static void igb_dma_err_timer(unsigned long data);
#endif
static void igb_watchdog_task(struct work_struct *);
static void igb_dma_err_task(struct work_struct *);
static void igb_dma_err_timer(unsigned long data);
/* AVB specific */
#ifdef HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK
static u16 igb_select_queue(struct net_device *dev, struct sk_buff *skb,
Expand Down Expand Up @@ -462,7 +469,7 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
u32 e1000_read_reg(struct e1000_hw *hw, u32 reg)
{
struct igb_adapter *igb = container_of(hw, struct igb_adapter, hw);
u8 __iomem *hw_addr = ACCESS_ONCE(hw->hw_addr);
u8 __iomem *hw_addr = READ_ONCE(hw->hw_addr);
u32 value = 0;

if (E1000_REMOVED(hw_addr))
Expand Down Expand Up @@ -2885,13 +2892,21 @@ static int igb_probe(struct pci_dev *pdev,
/* Check if Media Autosense is enabled */
if (hw->mac.type == e1000_82580)
igb_init_mas(adapter);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
timer_setup(&adapter->watchdog_timer, &igb_watchdog, 0);
if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA)
timer_setup(&adapter->dma_err_timer, &igb_dma_err_timer, 0);
timer_setup(&adapter->phy_info_timer, &igb_update_phy_info, 0);
#else
setup_timer(&adapter->watchdog_timer, &igb_watchdog,
(unsigned long) adapter);
if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA)
setup_timer(&adapter->dma_err_timer, &igb_dma_err_timer,
(unsigned long) adapter);
setup_timer(&adapter->phy_info_timer, &igb_update_phy_info,
(unsigned long) adapter);
#endif

INIT_WORK(&adapter->reset_task, igb_reset_task);
INIT_WORK(&adapter->watchdog_task, igb_watchdog_task);
Expand Down Expand Up @@ -4681,9 +4696,19 @@ static void igb_spoof_check(struct igb_adapter *adapter)
/* Need to wait a few seconds after link up to get diagnostic information from
* the phy
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
static void igb_update_phy_info(struct timer_list *timer)
#else
static void igb_update_phy_info(unsigned long data)
#endif
{
struct igb_adapter *adapter = (struct igb_adapter *) data;
struct igb_adapter *adapter;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
adapter = container_of(timer, struct igb_adapter, watchdog_timer);
#else
adapter = (struct igb_adapter *) data;
#endif

e1000_get_phy_info(&adapter->hw);
}
Expand Down Expand Up @@ -4733,9 +4758,20 @@ bool igb_has_link(struct igb_adapter *adapter)
* igb_watchdog - Timer Call-back
* @data: pointer to adapter cast into an unsigned long
**/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
static void igb_watchdog(struct timer_list *timer)
#else
static void igb_watchdog(unsigned long data)
#endif
{
struct igb_adapter *adapter = (struct igb_adapter *)data;
struct igb_adapter *adapter;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
adapter = container_of(timer, struct igb_adapter, watchdog_timer);
#else
adapter = (struct igb_adapter *)data;
#endif

/* Do the rest outside of interrupt context */
schedule_work(&adapter->watchdog_task);
}
Expand Down Expand Up @@ -4991,9 +5027,20 @@ static void igb_dma_err_task(struct work_struct *work)
* igb_dma_err_timer - Timer Call-back
* @data: pointer to adapter cast into an unsigned long
**/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
static void igb_dma_err_timer(struct timer_list *timer)
#else
static void igb_dma_err_timer(unsigned long data)
#endif
{
struct igb_adapter *adapter = (struct igb_adapter *)data;
struct igb_adapter *adapter;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
adapter = container_of(timer, struct igb_adapter, dma_err_timer);
#else
adapter = (struct igb_adapter *)data;
#endif

/* Do the rest outside of interrupt context */
schedule_work(&adapter->dma_err_task);
}
Expand Down
1 change: 1 addition & 0 deletions lib/igb/e1000_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct e1000_hw;
#define E1000_DEV_ID_I210_FIBER 0x1536
#define E1000_DEV_ID_I210_SERDES 0x1537
#define E1000_DEV_ID_I210_SGMII 0x1538
#define E1000_DEV_ID_I210_AUTOMOTIVE 0x15F6
#define E1000_DEV_ID_I210_COPPER_FLASHLESS 0x157B
#define E1000_DEV_ID_I210_SERDES_FLASHLESS 0x157C
#define E1000_DEV_ID_I211_COPPER 0x1539
Expand Down
1 change: 1 addition & 0 deletions lib/igb/igb.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ static igb_vendor_info_t igb_vendor_info_array[] = {
{ 0x8086, E1000_DEV_ID_I210_SERDES_FLASHLESS,
PCI_ANY_ID, PCI_ANY_ID, 0},
{ 0x8086, E1000_DEV_ID_I210_SGMII, PCI_ANY_ID, PCI_ANY_ID, 0},
{ 0x8086, E1000_DEV_ID_I210_AUTOMOTIVE, PCI_ANY_ID, PCI_ANY_ID, 0},
/* required last entry */
{ 0, 0, 0, 0, 0}
};
Expand Down
9 changes: 9 additions & 0 deletions lib/libavtp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ install_headers(
'include/avtp_aaf.h',
)

pkg = import('pkgconfig')
pkg.generate(
name: 'avtp',
description: 'AVTP packetization library',
version: '0.1',
url: 'github.com/AVnu/OpenAvnu',
libraries: avtp_lib,
)

test_avtp = executable(
'test-avtp',
'unit/test-avtp.c',
Expand Down

0 comments on commit ea7b51c

Please sign in to comment.