Advertisement
Guest User

Untitled

a guest
Feb 14th, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. diff -uP makeflags.sh tg3-3.124c/makeflags.sh
  2. --- makeflags.sh 2012-08-17 17:20:08.000000000 +0200
  3. +++ tg3-3.124c/makeflags.sh 2013-02-14 22:00:22.049585257 +0100
  4. @@ -211,10 +211,18 @@
  5. echo "#define BCM_HAS_ETHTOOL_CMD_SPEED_SET"
  6. fi
  7.  
  8. +if grep -q "ethtool_cmd_speed_set" $srcdir/include/uapi/linux/ethtool.h ; then
  9. + echo "#define BCM_HAS_ETHTOOL_CMD_SPEED_SET"
  10. +fi
  11. +
  12. if grep -q "ethtool_cmd_speed(" $srcdir/include/linux/ethtool.h ; then
  13. echo "#define BCM_HAS_ETHTOOL_CMD_SPEED"
  14. fi
  15.  
  16. +if grep -q "ethtool_cmd_speed(" $srcdir/include/uapi/linux/ethtool.h ; then
  17. + echo "#define BCM_HAS_ETHTOOL_CMD_SPEED"
  18. +fi
  19. +
  20. if grep -q "ETH_TEST_FL_EXTERNAL_LB_DONE" $srcdir/include/linux/ethtool.h ; then
  21. echo "#define BCM_HAS_EXTERNAL_LB_DONE"
  22. fi
  23. diff -uP tg3.c tg3-3.124c/tg3.c
  24. --- tg3.c 2012-08-17 17:26:49.000000000 +0200
  25. +++ tg3-3.124c/tg3.c 2013-02-14 22:20:14.365131741 +0100
  26. @@ -93,7 +93,7 @@
  27. #include <net/checksum.h>
  28. #include <net/ip.h>
  29.  
  30. -#include <asm/system.h>
  31. +/*#include <asm/system.h>*/
  32. #include <asm/io.h>
  33. #include <asm/byteorder.h>
  34. #include <asm/uaccess.h>
  35. @@ -500,6 +500,43 @@
  36.  
  37. #define TG3_NUM_TEST ARRAY_SIZE(ethtool_test_keys)
  38.  
  39. +static void tg3_irq_quiesce(struct tg3 *tp)
  40. +{
  41. +#if (LINUX_VERSION_CODE >= 0x2051c)
  42. + int i;
  43. +#endif
  44. +
  45. + BUG_ON(tp->irq_sync);
  46. +
  47. + tp->irq_sync = 1;
  48. + smp_mb();
  49. +
  50. +#if (LINUX_VERSION_CODE >= 0x2051c)
  51. + for (i = 0; i < tp->irq_cnt; i++)
  52. + synchronize_irq(tp->napi[i].irq_vec);
  53. +#else
  54. + synchronize_irq();
  55. +#endif
  56. +}
  57. +
  58. +
  59. +/* Fully shutdown all tg3 driver activity elsewhere in the system.
  60. + * If irq_sync is non-zero, then the IRQ handler must be synchronized
  61. + * with as well. Most of the time, this is not necessary except when
  62. + * shutting down the device.
  63. + */
  64. +static inline void tg3_full_lock(struct tg3 *tp, int irq_sync)
  65. +{
  66. + spin_lock_bh(&tp->lock);
  67. + if (irq_sync)
  68. + tg3_irq_quiesce(tp);
  69. +}
  70. +
  71. +static inline void tg3_full_unlock(struct tg3 *tp)
  72. +{
  73. + spin_unlock_bh(&tp->lock);
  74. +}
  75. +
  76.  
  77. static void tg3_write32(struct tg3 *tp, u32 off, u32 val)
  78. {
  79. @@ -6247,6 +6284,7 @@
  80. static void tg3_ptp_init(struct tg3 *tp)
  81. {
  82. struct timespec now;
  83. + struct device *dp = &tp->pdev->dev;
  84.  
  85. if (!tg3_flag(tp, PTP_CAPABLE))
  86. return;
  87. @@ -6261,7 +6299,7 @@
  88. memcpy(&tp->ptp_info, &tg3_ptp_caps, sizeof(tg3_ptp_caps));
  89. strncpy(tp->ptp_info.name, tp->dev->name, IFNAMSIZ);
  90.  
  91. - tp->ptp_clock = ptp_clock_register(&tp->ptp_info);
  92. + tp->ptp_clock = ptp_clock_register(&tp->ptp_info, dp);
  93. if (IS_ERR(tp->ptp_clock))
  94. tp->ptp_clock = NULL;
  95. }
  96. @@ -7552,41 +7590,7 @@
  97. tg3_enable_ints(tp);
  98. }
  99.  
  100. -static void tg3_irq_quiesce(struct tg3 *tp)
  101. -{
  102. -#if (LINUX_VERSION_CODE >= 0x2051c)
  103. - int i;
  104. -#endif
  105. -
  106. - BUG_ON(tp->irq_sync);
  107.  
  108. - tp->irq_sync = 1;
  109. - smp_mb();
  110. -
  111. -#if (LINUX_VERSION_CODE >= 0x2051c)
  112. - for (i = 0; i < tp->irq_cnt; i++)
  113. - synchronize_irq(tp->napi[i].irq_vec);
  114. -#else
  115. - synchronize_irq();
  116. -#endif
  117. -}
  118. -
  119. -/* Fully shutdown all tg3 driver activity elsewhere in the system.
  120. - * If irq_sync is non-zero, then the IRQ handler must be synchronized
  121. - * with as well. Most of the time, this is not necessary except when
  122. - * shutting down the device.
  123. - */
  124. -static inline void tg3_full_lock(struct tg3 *tp, int irq_sync)
  125. -{
  126. - spin_lock_bh(&tp->lock);
  127. - if (irq_sync)
  128. - tg3_irq_quiesce(tp);
  129. -}
  130. -
  131. -static inline void tg3_full_unlock(struct tg3 *tp)
  132. -{
  133. - spin_unlock_bh(&tp->lock);
  134. -}
  135.  
  136. /* One-shot MSI handler - Chip automatically disables interrupt
  137. * after sending MSI so driver doesn't have to do it.
  138. @@ -14531,8 +14535,10 @@
  139. .set_tso = tg3_set_tso,
  140. #endif
  141. #endif /* BCM_HAS_NETDEV_UPDATE_FEATURES */
  142. +#if (LINUX_VERSION_CODE < 0x30000)
  143. .get_sg = ethtool_op_get_sg,
  144. .set_sg = ethtool_op_set_sg,
  145. +#endif
  146. #if (LINUX_VERSION_CODE < 0x20618)
  147. .self_test_count = tg3_get_test_count,
  148. #endif
  149. @@ -16497,7 +16503,7 @@
  150. if (bridge->subordinate &&
  151. (bridge->subordinate->number <=
  152. tp->pdev->bus->number) &&
  153. - (bridge->subordinate->subordinate >=
  154. + (bridge->subordinate->busn_res.end >=
  155. tp->pdev->bus->number)) {
  156. tg3_flag_set(tp, 5701_DMA_BUG);
  157. pci_dev_put(bridge);
  158. @@ -16525,7 +16531,7 @@
  159. if (bridge && bridge->subordinate &&
  160. (bridge->subordinate->number <=
  161. tp->pdev->bus->number) &&
  162. - (bridge->subordinate->subordinate >=
  163. + (bridge->subordinate->busn_res.end >=
  164. tp->pdev->bus->number)) {
  165. tg3_flag_set(tp, 40BIT_DMA_BUG);
  166. pci_dev_put(bridge);
  167. @@ -18008,7 +18014,7 @@
  168. #ifdef BCM_HAS_NEW_INIT_WORK
  169. INIT_WORK(&tp->reset_task, tg3_reset_task);
  170. #else
  171. - INIT_WORK(&tp->reset_task, tg3_reset_task, tp);
  172. + INIT_WORK(&tp->reset_task, tg3_reset_task);
  173. #endif
  174.  
  175. tp->regs = pci_ioremap_bar(pdev, BAR_0);
  176. --- tg3_firmware.h 2012-08-17 17:20:08.000000000 +0200
  177. +++ tg3-3.124c/tg3_firmware.h 2012-11-01 17:06:56.000000000 +0100
  178. @@ -1,6 +1,6 @@
  179. /* Copyright (C) 2009-2012 Broadcom Corporation. */
  180.  
  181. -#ifdef NETIF_F_TSO
  182. +#ifdef XXXXNETIF_F_TSO
  183. #define TG3_TSO_SUPPORT 1
  184. #else
  185. #define TG3_TSO_SUPPORT 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement