e1000e_4.10_compat.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. src/{netdev.c.orig => netdev.c} | 18 +++++++++---------
  2. src/{ptp.c.orig => ptp.c} | 4 ++--
  3. 2 files changed, 11 insertions(+), 11 deletions(-)
  4. diff --git a/src/netdev.c.orig b/src/netdev.c
  5. index 73b0f9a..480265b 100644
  6. --- a/src/netdev.c.orig
  7. +++ b/src/netdev.c
  8. @@ -4833,24 +4833,24 @@ void e1000e_reinit_locked(struct e1000_adapter *adapter)
  9. /**
  10. * e1000e_sanitize_systim - sanitize raw cycle counter reads
  11. * @hw: pointer to the HW structure
  12. - * @systim: cycle_t value read, sanitized and returned
  13. + * @systim: u64 value read, sanitized and returned
  14. *
  15. * Errata for 82574/82583 possible bad bits read from SYSTIMH/L:
  16. * check to see that the time is incrementing at a reasonable
  17. * rate and is a multiple of incvalue.
  18. **/
  19. -static cycle_t e1000e_sanitize_systim(struct e1000_hw *hw, cycle_t systim)
  20. +static u64 e1000e_sanitize_systim(struct e1000_hw *hw, u64 systim)
  21. {
  22. u64 time_delta, rem, temp;
  23. - cycle_t systim_next;
  24. + u64 systim_next;
  25. u32 incvalue;
  26. int i;
  27. incvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;
  28. for (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {
  29. /* latch SYSTIMH on read of SYSTIML */
  30. - systim_next = (cycle_t)er32(SYSTIML);
  31. - systim_next |= (cycle_t)er32(SYSTIMH) << 32;
  32. + systim_next = (u64)er32(SYSTIML);
  33. + systim_next |= (u64)er32(SYSTIMH) << 32;
  34. time_delta = systim_next - systim;
  35. temp = time_delta;
  36. @@ -4872,13 +4872,13 @@ static cycle_t e1000e_sanitize_systim(struct e1000_hw *hw, cycle_t systim)
  37. * e1000e_cyclecounter_read - read raw cycle counter (used by time counter)
  38. * @cc: cyclecounter structure
  39. **/
  40. -static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc)
  41. +static u64 e1000e_cyclecounter_read(const struct cyclecounter *cc)
  42. {
  43. struct e1000_adapter *adapter = container_of(cc, struct e1000_adapter,
  44. cc);
  45. struct e1000_hw *hw = &adapter->hw;
  46. u32 systimel, systimeh;
  47. - cycle_t systim;
  48. + u64 systim;
  49. /* SYSTIMH latching upon SYSTIML read does not work well.
  50. * This means that if SYSTIML overflows after we read it but before
  51. * we read SYSTIMH, the value of SYSTIMH has been incremented and we
  52. @@ -4899,8 +4899,8 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc)
  53. systimel = systimel_2;
  54. }
  55. }
  56. - systim = (cycle_t)systimel;
  57. - systim |= (cycle_t)systimeh << 32;
  58. + systim = (u64)systimel;
  59. + systim |= (u64)systimeh << 32;
  60. if (adapter->flags2 & FLAG2_CHECK_SYSTIM_OVERFLOW)
  61. systim = e1000e_sanitize_systim(hw, systim);
  62. diff --git a/src/ptp.c.orig b/src/ptp.c
  63. index 00c419f..228adce 100644
  64. --- a/src/ptp.c.orig
  65. +++ b/src/ptp.c
  66. @@ -136,8 +136,8 @@ static int e1000e_phc_get_syncdevicetime(ktime_t * device,
  67. unsigned long flags;
  68. int i;
  69. u32 tsync_ctrl;
  70. - cycle_t dev_cycles;
  71. - cycle_t sys_cycles;
  72. + u64 dev_cycles;
  73. + u64 sys_cycles;
  74. tsync_ctrl = er32(TSYNCTXCTL);
  75. tsync_ctrl |= E1000_TSYNCTXCTL_START_SYNC |