+diff -urN xen-4.6.5/tools/firmware/etherboot/patches/drivers-fixes.patch xen-4.6.5.build/tools/firmware/etherboot/patches/drivers-fixes.patch
+--- xen-4.6.5/tools/firmware/etherboot/patches/drivers-fixes.patch 1970-01-01 01:00:00.000000000 +0100
++++ xen-4.6.5.build/tools/firmware/etherboot/patches/drivers-fixes.patch 2017-04-14 14:57:04.905408377 +0200
+@@ -0,0 +1,208 @@
++--- a/src/drivers/net/via-rhine.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/drivers/net/via-rhine.c 2017-04-14 14:19:52.286247054 +0200
++@@ -947,11 +947,10 @@
++ // if (tp->chip_id == 0x3065)
++ if( tp->chip_revision < 0x80 && tp->chip_revision >=0x40 )
++ intr_status |= inb(nic->ioaddr + IntrStatus2) << 16;
++- intr_status = (intr_status & ~DEFAULT_INTR);
++- if ( action == ENABLE )
++- intr_status = intr_status | DEFAULT_INTR;
++- outw(intr_status, nic->ioaddr + IntrEnable);
++- break;
+++ intr_status = (intr_status & ~DEFAULT_INTR);
+++ intr_status = intr_status | DEFAULT_INTR;
+++ outw(intr_status, nic->ioaddr + IntrEnable);
+++ break;
++ case FORCE :
++ outw(0x0010, nic->ioaddr + 0x84);
++ break;
++--- a/src/drivers/net/skge.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/drivers/net/skge.c 2017-04-14 14:24:41.466448500 +0200
++@@ -83,9 +83,6 @@
++ /* Avoid conditionals by using array */
++ static const int txqaddr[] = { Q_XA1, Q_XA2 };
++ static const int rxqaddr[] = { Q_R1, Q_R2 };
++-static const u32 rxirqmask[] = { IS_R1_F, IS_R2_F };
++-static const u32 txirqmask[] = { IS_XA1_F, IS_XA2_F };
++-static const u32 napimask[] = { IS_R1_F|IS_XA1_F, IS_R2_F|IS_XA2_F };
++ static const u32 portmask[] = { IS_PORT_1, IS_PORT_2 };
++
++ /* Determine supported/advertised modes based on hardware.
++@@ -1921,8 +1918,6 @@
++ skge->tx_ring.to_clean = e;
++ }
++
++-static const u8 pause_mc_addr[ETH_ALEN] = { 0x1, 0x80, 0xc2, 0x0, 0x0, 0x1 };
++-
++ static inline u16 phy_length(const struct skge_hw *hw, u32 status)
++ {
++ if (hw->chip_id == CHIP_ID_GENESIS)
++--- a/src/drivers/net/sis190.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/drivers/net/sis190.c 2017-04-14 14:26:03.937456678 +0200
++@@ -72,12 +72,6 @@
++ static const u32 sis190_intr_mask =
++ RxQEmpty | RxQInt | TxQ1Int | TxQ0Int | RxHalt | TxHalt | LinkChange;
++
++-/*
++- * Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
++- * The chips use a 64 element hash table based on the Ethernet CRC.
++- */
++-static const int multicast_filter_limit = 32;
++-
++ static void __mdio_cmd(void *ioaddr, u32 ctl)
++ {
++ unsigned int i;
++--- a/src/drivers/net/via-velocity.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/drivers/net/via-velocity.c 2017-04-14 14:29:33.906690274 +0200
++@@ -95,7 +95,7 @@
++ 2: indicate the rxfifo threshold is 1024 bytes.
++ 3: indicate the rxfifo threshold is store & forward.
++ */
++-VELOCITY_PARAM(rx_thresh, "Receive fifo threshold");
+++//VELOCITY_PARAM(rx_thresh, "Receive fifo threshold");
++
++ #define DMA_LENGTH_MIN 0
++ #define DMA_LENGTH_MAX 7
++--- a/src/drivers/net/e1000/e1000_phy.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/drivers/net/e1000/e1000_phy.c 2017-04-14 14:40:51.169290852 +0200
++@@ -167,18 +167,18 @@
++ if (!(phy->ops.read_reg))
++ goto out;
++
++- ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
++- if (ret_val)
++- goto out;
+++ ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
+++ if (ret_val)
+++ goto out;
++
++- phy->id = (u32)(phy_id << 16);
++- usec_delay(20);
++- ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
++- if (ret_val)
++- goto out;
+++ phy->id = (u32)(phy_id << 16);
+++ usec_delay(20);
+++ ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
+++ if (ret_val)
+++ goto out;
++
++- phy->id |= (u32)(phy_id & PHY_REVISION_MASK);
++- phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
+++ phy->id |= (u32)(phy_id & PHY_REVISION_MASK);
+++ phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
++
++ out:
++ return ret_val;
++--- a/src/drivers/net/igb/igb_phy.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/drivers/net/igb/igb_phy.c 2017-04-14 14:43:20.841332677 +0200
++@@ -91,18 +91,18 @@
++ if (!(phy->ops.read_reg))
++ goto out;
++
++- ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
++- if (ret_val)
++- goto out;
+++ ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
+++ if (ret_val)
+++ goto out;
++
++- phy->id = (u32)(phy_id << 16);
++- usec_delay(20);
++- ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
++- if (ret_val)
++- goto out;
+++ phy->id = (u32)(phy_id << 16);
+++ usec_delay(20);
+++ ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
+++ if (ret_val)
+++ goto out;
++
++- phy->id |= (u32)(phy_id & PHY_REVISION_MASK);
++- phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
+++ phy->id |= (u32)(phy_id & PHY_REVISION_MASK);
+++ phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
++
++ out:
++ return ret_val;
++--- a/src/drivers/net/ath/ath5k/ath5k_reset.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/drivers/net/ath/ath5k/ath5k_reset.c 2017-04-14 14:44:37.299026150 +0200
++@@ -135,13 +135,6 @@
++ }
++
++
++-/*
++- * index into rates for control rates, we can set it up like this because
++- * this is only used for AR5212 and we know it supports G mode
++- */
++-static const unsigned int control_rates[] =
++- { 0, 1, 1, 1, 4, 4, 6, 6, 8, 8, 8, 8 };
++-
++ /**
++ * ath5k_hw_write_rate_duration - fill rate code to duration table
++ *
++--- a/src/drivers/net/ath/ath5k/ath5k.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/drivers/net/ath/ath5k/ath5k.c 2017-04-14 14:46:52.610822110 +0200
++@@ -85,6 +85,7 @@
++ PCI_ROM(0x168c, 0x001d, "ath2417", "Atheros 2417 Nala", AR5K_AR5212),
++ };
++
+++#if DBGLVL_MAX
++ /* Known SREVs */
++ static const struct ath5k_srev_name srev_names[] = {
++ { "5210", AR5K_VERSION_MAC, AR5K_SREV_AR5210 },
++@@ -124,6 +125,7 @@
++ { "5133", AR5K_VERSION_RAD, AR5K_SREV_RAD_5133 },
++ { "xxxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN },
++ };
+++#endif
++
++ #define ATH5K_SPMBL_NO 1
++ #define ATH5K_SPMBL_YES 2
++--- a/src/drivers/net/ath/ath5k/ath5k_phy.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/drivers/net/ath/ath5k/ath5k_phy.c 2017-04-14 14:50:38.760444548 +0200
++@@ -1219,12 +1219,12 @@
++
++ /* Update radio registers */
++ ath5k_hw_reg_write(ah, (phy_sig & ~(AR5K_PHY_SIG_FIRPWR)) |
++- AR5K_REG_SM(-1, AR5K_PHY_SIG_FIRPWR), AR5K_PHY_SIG);
+++ AR5K_REG_SM(-1U, AR5K_PHY_SIG_FIRPWR), AR5K_PHY_SIG);
++
++ ath5k_hw_reg_write(ah, (phy_agc & ~(AR5K_PHY_AGCCOARSE_HI |
++ AR5K_PHY_AGCCOARSE_LO)) |
++- AR5K_REG_SM(-1, AR5K_PHY_AGCCOARSE_HI) |
++- AR5K_REG_SM(-127, AR5K_PHY_AGCCOARSE_LO), AR5K_PHY_AGCCOARSE);
+++ AR5K_REG_SM(-1U, AR5K_PHY_AGCCOARSE_HI) |
+++ AR5K_REG_SM(-127U, AR5K_PHY_AGCCOARSE_LO), AR5K_PHY_AGCCOARSE);
++
++ ath5k_hw_reg_write(ah, (phy_sat & ~(AR5K_PHY_ADCSAT_ICNT |
++ AR5K_PHY_ADCSAT_THR)) |
++--- a/src/drivers/net/ath/ath9k/ath9k_eeprom.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/drivers/net/ath/ath9k/ath9k_eeprom.c 2017-04-14 14:56:36.021706193 +0200
++@@ -371,7 +371,7 @@
++ /* FIXME: array overrun? */
++ for (i = 0; i < numXpdGains; i++) {
++ minPwrT4[i] = data_9287[idxL].pwrPdg[i][0];
++- maxPwrT4[i] = data_9287[idxL].pwrPdg[i][4];
+++ maxPwrT4[i] = data_9287[idxL].pwrPdg[i][intercepts - 1];
++ ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
++ data_9287[idxL].pwrPdg[i],
++ data_9287[idxL].vpdPdg[i],
++@@ -381,7 +381,7 @@
++ } else if (eeprom_4k) {
++ for (i = 0; i < numXpdGains; i++) {
++ minPwrT4[i] = data_4k[idxL].pwrPdg[i][0];
++- maxPwrT4[i] = data_4k[idxL].pwrPdg[i][4];
+++ maxPwrT4[i] = data_4k[idxL].pwrPdg[i][intercepts - 1];
++ ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
++ data_4k[idxL].pwrPdg[i],
++ data_4k[idxL].vpdPdg[i],
++@@ -391,7 +391,7 @@
++ } else {
++ for (i = 0; i < numXpdGains; i++) {
++ minPwrT4[i] = data_def[idxL].pwrPdg[i][0];
++- maxPwrT4[i] = data_def[idxL].pwrPdg[i][4];
+++ maxPwrT4[i] = data_def[idxL].pwrPdg[i][intercepts - 1];
++ ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
++ data_def[idxL].pwrPdg[i],
++ data_def[idxL].vpdPdg[i],
+diff -urN xen-4.6.5/tools/firmware/etherboot/patches/have-strtok.patch xen-4.6.5.build/tools/firmware/etherboot/patches/have-strtok.patch
+--- xen-4.6.5/tools/firmware/etherboot/patches/have-strtok.patch 1970-01-01 01:00:00.000000000 +0100
++++ xen-4.6.5.build/tools/firmware/etherboot/patches/have-strtok.patch 2017-04-14 14:07:35.483912837 +0200
+@@ -0,0 +1,11 @@
++--- a/src/core/stringextra.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/core/stringextra.c 2017-04-14 14:07:03.470188756 +0200
++@@ -174,7 +174,7 @@
++ }
++ #endif
++
++-#ifndef __HAVE_ARCH_STRTOK
+++#if 0
++ /**
++ * strtok - Split a string into tokens
++ * @s: The string to be searched
+diff -urN xen-4.6.5/tools/firmware/etherboot/patches/mucurses-fix.patch xen-4.6.5.build/tools/firmware/etherboot/patches/mucurses-fix.patch
+--- xen-4.6.5/tools/firmware/etherboot/patches/mucurses-fix.patch 1970-01-01 01:00:00.000000000 +0100
++++ xen-4.6.5.build/tools/firmware/etherboot/patches/mucurses-fix.patch 2017-04-14 14:59:46.177462840 +0200
+@@ -0,0 +1,48 @@
++--- a/src/hci/mucurses/windows.c~ 2011-12-11 03:28:04.000000000 +0100
+++++ b/src/hci/mucurses/windows.c 2017-04-14 14:59:23.907179591 +0200
++@@ -16,9 +16,6 @@
++ * @ret rc return status code
++ */
++ int delwin ( WINDOW *win ) {
++- if ( win == NULL )
++- return ERR;
++-
++ /* I think we should blank the region covered by the window -
++ ncurses doesn't do this, but they have a buffer, so they
++ may just be deleting from an offscreen context whereas we
++@@ -49,8 +46,6 @@
++ WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
++ int begin_y, int begin_x ) {
++ WINDOW *child;
++- if ( parent == NULL )
++- return NULL;
++ if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
++ return NULL;
++ if ( ( (unsigned)ncols > parent->width ) ||
++@@ -73,8 +68,6 @@
++ */
++ WINDOW *dupwin ( WINDOW *orig ) {
++ WINDOW *copy;
++- if ( orig == NULL )
++- return NULL;
++ if ( ( copy = malloc( sizeof( WINDOW ) ) ) == NULL )
++ return NULL;
++ copy->scr = orig->scr;
++@@ -97,8 +90,6 @@
++ * @ret rc return status code
++ */
++ int mvwin ( WINDOW *win, int y, int x ) {
++- if ( win == NULL )
++- return ERR;
++ if ( ( ( (unsigned)y + win->height ) > LINES ) ||
++ ( ( (unsigned)x + win->width ) > COLS ) )
++ return ERR;
++@@ -147,8 +138,6 @@
++ WINDOW *subwin ( WINDOW *parent, int nlines, int ncols,
++ int begin_y, int begin_x ) {
++ WINDOW *child;
++- if ( parent == NULL )
++- return NULL;
++ if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
++ return NULL;
++ child = newwin( nlines, ncols, begin_y, begin_x );
+diff -urN xen-4.6.5/tools/firmware/etherboot/patches/series xen-4.6.5.build/tools/firmware/etherboot/patches/series
+--- xen-4.6.5/tools/firmware/etherboot/patches/series 2017-03-07 17:19:05.000000000 +0100
++++ xen-4.6.5.build/tools/firmware/etherboot/patches/series 2017-04-14 14:59:51.384195712 +0200
+@@ -4,3 +4,7 @@
+ build_fix_3.patch
+ build-compare.patch
+ build_fix_4.patch
++have-strtok.patch
++unused-variable.patch
++drivers-fixes.patch
++mucurses-fix.patch
+diff -urN xen-4.6.5/tools/firmware/etherboot/patches/unused-variable.patch xen-4.6.5.build/tools/firmware/etherboot/patches/unused-variable.patch
+--- xen-4.6.5/tools/firmware/etherboot/patches/unused-variable.patch 1970-01-01 01:00:00.000000000 +0100
++++ xen-4.6.5.build/tools/firmware/etherboot/patches/unused-variable.patch 2017-04-14 14:15:17.032883274 +0200
+@@ -0,0 +1,12 @@
++--- a/src/include/nic.h~ 2017-04-14 14:13:09.000000000 +0200
+++++ b/src/include/nic.h 2017-04-14 14:13:37.061661840 +0200
++@@ -199,7 +199,8 @@
++
++ #undef DRIVER
++ #define DRIVER(_name_text,_unused2,_unused3,_name,_probe,_disable) \
++- static const char _name ## _text[] = _name_text; \
+++ static __attribute__ (( unused )) const char \
+++ _name ## _text[] = _name_text; \
++ static inline int \
++ _name ## _probe ( struct nic *nic, void *hwdev ) { \
++ return _probe ( nic, hwdev ); \