Skip site navigation (1)Skip section navigation (2)

CVS log for src/sys/dev/bge/if_bge.c

[BACK] Up to [FreeBSD] / src / sys / dev / bge

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.373: download - view: text, markup, annotated - select for diffs
Tue Feb 7 20:24:52 2012 UTC (2 days, 21 hours ago) by marius
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.372: preferred, colored
Changes since revision 1.372: +2 -2 lines
SVN rev 231159 on 2012-02-07 20:24:52Z by marius

Call bge_add_sysctls() early and especially before bge_can_use_msi() so
r230337 actually has a chance of working and doesn't always unconditionally
disable the use of MSIs.

Revision 1.226.2.63: download - view: text, markup, annotated - select for diffs
Sun Jan 29 01:22:48 2012 UTC (12 days, 16 hours ago) by marius
Branches: RELENG_8
Diff to: previous 1.226.2.62: preferred, colored; branchpoint 1.226: preferred, colored; next MAIN 1.227: preferred, colored
Changes since revision 1.226.2.62: +1 -5 lines
SVN rev 230714 on 2012-01-29 01:22:48Z by marius

MFC: r227843 (partial)

- There's no need to overwrite the default device method with the default
  one. Interestingly, these are actually the default for quite some time
  (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
  since r52045) but even recently added device drivers do this unnecessarily.
  Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
  Discussed with: jhb
- Also while at it, use __FBSDID.

Revision 1.372: download - view: text, markup, annotated - select for diffs
Thu Jan 19 20:28:58 2012 UTC (3 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.371: preferred, colored
Changes since revision 1.371: +1 -1 lines
SVN rev 230338 on 2012-01-19 20:28:58Z by yongari

Oops, fix logic error introduced in r230337.

Revision 1.371: download - view: text, markup, annotated - select for diffs
Thu Jan 19 20:21:59 2012 UTC (3 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.370: preferred, colored
Changes since revision 1.370: +6 -6 lines
SVN rev 230337 on 2012-01-19 20:21:59Z by yongari

Rename dev.bge.%d.msi_disable to dev.bge.%d.msi which matches
enable/disable and default it to on.

Suggested by:	jhb

Revision 1.370: download - view: text, markup, annotated - select for diffs
Tue Jan 17 22:15:33 2012 UTC (3 weeks, 2 days ago) by yongari
Branches: MAIN
Diff to: previous 1.369: preferred, colored
Changes since revision 1.369: +9 -0 lines
SVN rev 230286 on 2012-01-17 22:15:33Z by yongari

Introduce a tunable that disables use of MSI.
Non-zero value will use INTx.

Revision 1.198.2.78: download - view: text, markup, annotated - select for diffs
Mon Jan 9 19:23:29 2012 UTC (4 weeks, 3 days ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.77: preferred, colored; branchpoint 1.198: preferred, colored; next MAIN 1.199: preferred, colored
Changes since revision 1.198.2.77: +19 -3 lines
SVN rev 229869 on 2012-01-09 19:23:29Z by yongari

MFC r228479-228480:
r228479:
  BCM5720 performance tweak from Broadcom.
   o Allow multiple outstanding read requests from non-LSO read DMA engine.
   o Allow 4KB burst length reads for non-LSO frames.
   o Enable 512B burst length reads for buffer descriptors.

r228480:
  Destroy DMA tag for jumbo RX buffer in device detach.

Revision 1.226.2.62: download - view: text, markup, annotated - select for diffs
Mon Jan 9 19:20:46 2012 UTC (4 weeks, 3 days ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.61: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.61: +19 -3 lines
SVN rev 229868 on 2012-01-09 19:20:46Z by yongari

MFC r228479-228480:
r228479:
  BCM5720 performance tweak from Broadcom.
   o Allow multiple outstanding read requests from non-LSO read DMA engine.
   o Allow 4KB burst length reads for non-LSO frames.
   o Enable 512B burst length reads for buffer descriptors.

r228480:
  Destroy DMA tag for jumbo RX buffer in device detach.

Revision 1.350.2.6: download - view: text, markup, annotated - select for diffs
Mon Jan 9 19:18:53 2012 UTC (4 weeks, 3 days ago) by yongari
Branches: RELENG_9
Diff to: previous 1.350.2.5: preferred, colored; branchpoint 1.350: preferred, colored; next MAIN 1.351: preferred, colored
Changes since revision 1.350.2.5: +19 -3 lines
SVN rev 229867 on 2012-01-09 19:18:53Z by yongari

MFC r228479-228480:
r228479:
  BCM5720 performance tweak from Broadcom.
   o Allow multiple outstanding read requests from non-LSO read DMA engine.
   o Allow 4KB burst length reads for non-LSO frames.
   o Enable 512B burst length reads for buffer descriptors.

r228480:
  Destroy DMA tag for jumbo RX buffer in device detach.

Revision 1.198.2.77: download - view: text, markup, annotated - select for diffs
Tue Jan 3 01:07:02 2012 UTC (5 weeks, 3 days ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.76: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.76: +94 -21 lines
SVN rev 229362 on 2012-01-03 01:07:02Z by yongari

MFC r226871-226872:
r226871:
  Add initial BCM5720 support.
  Many thanks to Broadcom for continuing support of FreeBSD.

  Submitted by:		Geans Pin at Broadcom (initial version)
  H/W donated by:	Broadcom

r226872:
  Disable updating InputDiscards counter for BCM5717, BCM5718,
  BCM5719 A0 and BCM5720 A0 and add comment why driver does not try
  to read it.

Revision 1.226.2.61: download - view: text, markup, annotated - select for diffs
Tue Jan 3 01:02:26 2012 UTC (5 weeks, 3 days ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.60: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.60: +94 -21 lines
SVN rev 229361 on 2012-01-03 01:02:26Z by yongari

MFC r226871-226872:
r226871:
  Add initial BCM5720 support.
  Many thanks to Broadcom for continuing support of FreeBSD.

  Submitted by:		Geans Pin at Broadcom (initial version)
  H/W donated by:	Broadcom

r226872:
  Disable updating InputDiscards counter for BCM5717, BCM5718,
  BCM5719 A0 and BCM5720 A0 and add comment why driver does not try
  to read it.

Revision 1.350.2.5: download - view: text, markup, annotated - select for diffs
Tue Jan 3 00:56:05 2012 UTC (5 weeks, 3 days ago) by yongari
Branches: RELENG_9
Diff to: previous 1.350.2.4: preferred, colored; branchpoint 1.350: preferred, colored
Changes since revision 1.350.2.4: +94 -21 lines
SVN rev 229360 on 2012-01-03 00:56:05Z by yongari

MFC r226871-226872:
r226871:
  Add initial BCM5720 support.
  Many thanks to Broadcom for continuing support of FreeBSD.

  Submitted by:		Geans Pin at Broadcom (initial version)
  H/W donated by:	Broadcom

r226872:
  Disable updating InputDiscards counter for BCM5717, BCM5718,
  BCM5719 A0 and BCM5720 A0 and add comment why driver does not try
  to read it.

Revision 1.198.2.76: download - view: text, markup, annotated - select for diffs
Tue Jan 3 00:26:11 2012 UTC (5 weeks, 3 days ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.75: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.75: +37 -28 lines
SVN rev 229356 on 2012-01-03 00:26:11Z by yongari

MFC r226814-226815,226820-226821,226864,226866-226867:
r226814:
  Rename definition of BGE_SOFTWARE_GENCOMM_* to more readable ones.
  The origin of GENCOMM seems to come from Alteon Tigon Host/NIC
  interface definition where it defines general communications region
  which is active when firmware is loaded and running.  This region
  was used in communication between the host and processor internal
  to the Tigon chip.
  Broadcom data sheet also defines the region as 'Software Gencomm'
  in NetXtreme memory map but lacks detailed description of its
  interface so it was hard to know which ones are used for which
  interface.
  This change shall slightly enhance readability.

  No functional changes.

r226815:
  Define MAC address mail box and use it instead of using
  hard-coded value.

r226820:
  Offset 0x6810 is RX-RISC event register. Rename BGE_CPU_EVENT with
  BGE_RX_CPU_EVENT for readability.
  Additionally define BGE_TX_CPU_EVENT for TX-RSIC event register(BCM570[0-4] only).

r226821:
  SRAM offset 0x0C04 is used by driver to inform the IPMI/ASF firmware
  about the various driver events like load, unload, reset, suspend,
  restart, and ioctl operations.
  Define driver's event rather than using hard-coded values.  We don't
  still send suspend/resume event to firmware.

  Previously bge(4) used BGE_SDI_STATUS to send events. Because driver
  has to access firmware mail box to inform current state, using
  BGE_SDI_STATUS register was wrong. The end result was the same as
  BGE_SDI_STATUS is 0x0C04.

  No functional changes.

r226864:
  Rename BGE_FW_DRV_ALIVE/BGE_FW_PAUSE to BGE_FW_CMD_DRV_ALIVE/BGE_FW_CMD_PAUSE.
  Also add more firmware commands(not used yet).
  No functional changes.

r226866:
  Rename hard-coded value 1 << 14 with BGE_RX_CPU_DRV_EVENT.
  This bit(SW event 7 in publicly available data sheet) is used to
  make RX CPU handle a firmware command and the bit is automatically
  cleared after RX CPU completed the command.
  Generally firmware command takes the following steps.
   1. Write BGE_SRAM_FW_CMD_MB with a command.
   2. Write BGE_SRAM_FW_CMD_LEN_MB with the length of the command in bytes.
   3. Write BGE_SRAM_FW_CMD_DATA_MB with actual command data.
   4. Generate BGE_RX_CPU_EVENT and let firmware handle the command.
   5. Wait for the ACK of the firmware command.

  No functional changes.

r226867:
  Define BGE_FW_HB_TIMEOUT_SEC and remove one more magic value.
  bge(4) sends BGE_FW_CMD_DRV_ALIVE command to firmware every 2
  seconds.  BGE_FW_CMD_DRV_ALIVE command requires 4 bytes data.  This
  data contains timeout value in seconds until the next
  BGE_FW_CMD_DRV_ALIVE command.
  Broadcom recommends driver set the value 3 times longer than the
  interval that it sends BGE_FW_CMD_DRV_ALIVE.  Currently bge(4) uses
  3 seconds so probably we have to increase it in future and use
  different ALIVE command(e.g. BGE_FW_CMD_DRV_ALIVE3).

  No functional changes.

Revision 1.226.2.60: download - view: text, markup, annotated - select for diffs
Tue Jan 3 00:24:44 2012 UTC (5 weeks, 3 days ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.59: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.59: +37 -28 lines
SVN rev 229355 on 2012-01-03 00:24:44Z by yongari

MFC r226814-226815,226820-226821,226864,226866-226867:
r226814:
  Rename definition of BGE_SOFTWARE_GENCOMM_* to more readable ones.
  The origin of GENCOMM seems to come from Alteon Tigon Host/NIC
  interface definition where it defines general communications region
  which is active when firmware is loaded and running.  This region
  was used in communication between the host and processor internal
  to the Tigon chip.
  Broadcom data sheet also defines the region as 'Software Gencomm'
  in NetXtreme memory map but lacks detailed description of its
  interface so it was hard to know which ones are used for which
  interface.
  This change shall slightly enhance readability.

  No functional changes.

r226815:
  Define MAC address mail box and use it instead of using
  hard-coded value.

r226820:
  Offset 0x6810 is RX-RISC event register. Rename BGE_CPU_EVENT with
  BGE_RX_CPU_EVENT for readability.
  Additionally define BGE_TX_CPU_EVENT for TX-RSIC event register(BCM570[0-4] only).

r226821:
  SRAM offset 0x0C04 is used by driver to inform the IPMI/ASF firmware
  about the various driver events like load, unload, reset, suspend,
  restart, and ioctl operations.
  Define driver's event rather than using hard-coded values.  We don't
  still send suspend/resume event to firmware.

  Previously bge(4) used BGE_SDI_STATUS to send events. Because driver
  has to access firmware mail box to inform current state, using
  BGE_SDI_STATUS register was wrong. The end result was the same as
  BGE_SDI_STATUS is 0x0C04.

  No functional changes.

r226864:
  Rename BGE_FW_DRV_ALIVE/BGE_FW_PAUSE to BGE_FW_CMD_DRV_ALIVE/BGE_FW_CMD_PAUSE.
  Also add more firmware commands(not used yet).
  No functional changes.

r226866:
  Rename hard-coded value 1 << 14 with BGE_RX_CPU_DRV_EVENT.
  This bit(SW event 7 in publicly available data sheet) is used to
  make RX CPU handle a firmware command and the bit is automatically
  cleared after RX CPU completed the command.
  Generally firmware command takes the following steps.
   1. Write BGE_SRAM_FW_CMD_MB with a command.
   2. Write BGE_SRAM_FW_CMD_LEN_MB with the length of the command in bytes.
   3. Write BGE_SRAM_FW_CMD_DATA_MB with actual command data.
   4. Generate BGE_RX_CPU_EVENT and let firmware handle the command.
   5. Wait for the ACK of the firmware command.

  No functional changes.

r226867:
  Define BGE_FW_HB_TIMEOUT_SEC and remove one more magic value.
  bge(4) sends BGE_FW_CMD_DRV_ALIVE command to firmware every 2
  seconds.  BGE_FW_CMD_DRV_ALIVE command requires 4 bytes data.  This
  data contains timeout value in seconds until the next
  BGE_FW_CMD_DRV_ALIVE command.
  Broadcom recommends driver set the value 3 times longer than the
  interval that it sends BGE_FW_CMD_DRV_ALIVE.  Currently bge(4) uses
  3 seconds so probably we have to increase it in future and use
  different ALIVE command(e.g. BGE_FW_CMD_DRV_ALIVE3).

  No functional changes.

Revision 1.350.2.4: download - view: text, markup, annotated - select for diffs
Tue Jan 3 00:22:57 2012 UTC (5 weeks, 3 days ago) by yongari
Branches: RELENG_9
Diff to: previous 1.350.2.3: preferred, colored; branchpoint 1.350: preferred, colored
Changes since revision 1.350.2.3: +37 -28 lines
SVN rev 229354 on 2012-01-03 00:22:57Z by yongari

MFC r226814-226815,226820-226821,226864,226866-226867:
r226814:
  Rename definition of BGE_SOFTWARE_GENCOMM_* to more readable ones.
  The origin of GENCOMM seems to come from Alteon Tigon Host/NIC
  interface definition where it defines general communications region
  which is active when firmware is loaded and running.  This region
  was used in communication between the host and processor internal
  to the Tigon chip.
  Broadcom data sheet also defines the region as 'Software Gencomm'
  in NetXtreme memory map but lacks detailed description of its
  interface so it was hard to know which ones are used for which
  interface.
  This change shall slightly enhance readability.

  No functional changes.

r226815:
  Define MAC address mail box and use it instead of using
  hard-coded value.

r226820:
  Offset 0x6810 is RX-RISC event register. Rename BGE_CPU_EVENT with
  BGE_RX_CPU_EVENT for readability.
  Additionally define BGE_TX_CPU_EVENT for TX-RSIC event register(BCM570[0-4] only).

r226821:
  SRAM offset 0x0C04 is used by driver to inform the IPMI/ASF firmware
  about the various driver events like load, unload, reset, suspend,
  restart, and ioctl operations.
  Define driver's event rather than using hard-coded values.  We don't
  still send suspend/resume event to firmware.

  Previously bge(4) used BGE_SDI_STATUS to send events. Because driver
  has to access firmware mail box to inform current state, using
  BGE_SDI_STATUS register was wrong. The end result was the same as
  BGE_SDI_STATUS is 0x0C04.

  No functional changes.

r226864:
  Rename BGE_FW_DRV_ALIVE/BGE_FW_PAUSE to BGE_FW_CMD_DRV_ALIVE/BGE_FW_CMD_PAUSE.
  Also add more firmware commands(not used yet).
  No functional changes.

r226866:
  Rename hard-coded value 1 << 14 with BGE_RX_CPU_DRV_EVENT.
  This bit(SW event 7 in publicly available data sheet) is used to
  make RX CPU handle a firmware command and the bit is automatically
  cleared after RX CPU completed the command.
  Generally firmware command takes the following steps.
   1. Write BGE_SRAM_FW_CMD_MB with a command.
   2. Write BGE_SRAM_FW_CMD_LEN_MB with the length of the command in bytes.
   3. Write BGE_SRAM_FW_CMD_DATA_MB with actual command data.
   4. Generate BGE_RX_CPU_EVENT and let firmware handle the command.
   5. Wait for the ACK of the firmware command.

  No functional changes.

r226867:
  Define BGE_FW_HB_TIMEOUT_SEC and remove one more magic value.
  bge(4) sends BGE_FW_CMD_DRV_ALIVE command to firmware every 2
  seconds.  BGE_FW_CMD_DRV_ALIVE command requires 4 bytes data.  This
  data contains timeout value in seconds until the next
  BGE_FW_CMD_DRV_ALIVE command.
  Broadcom recommends driver set the value 3 times longer than the
  interval that it sends BGE_FW_CMD_DRV_ALIVE.  Currently bge(4) uses
  3 seconds so probably we have to increase it in future and use
  different ALIVE command(e.g. BGE_FW_CMD_DRV_ALIVE3).

  No functional changes.

Revision 1.198.2.75: download - view: text, markup, annotated - select for diffs
Tue Jan 3 00:12:06 2012 UTC (5 weeks, 3 days ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.74: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.74: +38 -20 lines
SVN rev 229352 on 2012-01-03 00:12:06Z by yongari

MFC r226749,226770,226804-226807:
r226749:
  Whitespace nits.

r226770:
  Fix long standing bge_sysctl_debug_info() issues.
   o Protect bge(4) status block access and register dump with driver lock.
   o Add missing bus_dmamap_sync() before dumping status block.
   o Use minimum status block size, 32 bytes, for status block dump on most
     controllers except BCM5700 AX/BX.
  While I'm here, make the handler show 5717 Plus in hardware flags.

r226804:
  Make CPMU handle GPHY power down control on controllers that have
  CPMU capability.

r226805:
  It is known that all Broadcom controllers have 4GB boundary DMA
  bug.  Apply workaround to all controllers.

r226806:
  Broadcom says BCM5755 or higher and BCM5906 have short DMA bug.
  Apply workaround to these controllers.

r226807:
  BCM5719 cannot handle DMA requests for DMA segments that have
  larger than 4KB in size.  However the maximum DMA segment size
  created in DMA tag is 4KB, so we wouldn't encounter the issue here.
  Just record this issue such that let developers not to create a DMA
  segment that is larger than 4KB for BCM5719. It's possible to split
  a DMA segment into multiple smaller ones in run time but I believe
  it's not worth to implement that.

Revision 1.226.2.59: download - view: text, markup, annotated - select for diffs
Tue Jan 3 00:10:30 2012 UTC (5 weeks, 3 days ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.58: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.58: +38 -20 lines
SVN rev 229351 on 2012-01-03 00:10:30Z by yongari

MFC r226749,226770,226804-226807:
r226749:
  Whitespace nits.

r226770:
  Fix long standing bge_sysctl_debug_info() issues.
   o Protect bge(4) status block access and register dump with driver lock.
   o Add missing bus_dmamap_sync() before dumping status block.
   o Use minimum status block size, 32 bytes, for status block dump on most
     controllers except BCM5700 AX/BX.
  While I'm here, make the handler show 5717 Plus in hardware flags.

r226804:
  Make CPMU handle GPHY power down control on controllers that have
  CPMU capability.

r226805:
  It is known that all Broadcom controllers have 4GB boundary DMA
  bug.  Apply workaround to all controllers.

r226806:
  Broadcom says BCM5755 or higher and BCM5906 have short DMA bug.
  Apply workaround to these controllers.

r226807:
  BCM5719 cannot handle DMA requests for DMA segments that have
  larger than 4KB in size.  However the maximum DMA segment size
  created in DMA tag is 4KB, so we wouldn't encounter the issue here.
  Just record this issue such that let developers not to create a DMA
  segment that is larger than 4KB for BCM5719. It's possible to split
  a DMA segment into multiple smaller ones in run time but I believe
  it's not worth to implement that.

Revision 1.350.2.3: download - view: text, markup, annotated - select for diffs
Tue Jan 3 00:07:49 2012 UTC (5 weeks, 3 days ago) by yongari
Branches: RELENG_9
Diff to: previous 1.350.2.2: preferred, colored; branchpoint 1.350: preferred, colored
Changes since revision 1.350.2.2: +38 -20 lines
SVN rev 229350 on 2012-01-03 00:07:49Z by yongari

MFC r226749,226770,226804-226807:
r226749:
  Whitespace nits.

r226770:
  Fix long standing bge_sysctl_debug_info() issues.
   o Protect bge(4) status block access and register dump with driver lock.
   o Add missing bus_dmamap_sync() before dumping status block.
   o Use minimum status block size, 32 bytes, for status block dump on most
     controllers except BCM5700 AX/BX.
  While I'm here, make the handler show 5717 Plus in hardware flags.

r226804:
  Make CPMU handle GPHY power down control on controllers that have
  CPMU capability.

r226805:
  It is known that all Broadcom controllers have 4GB boundary DMA
  bug.  Apply workaround to all controllers.

r226806:
  Broadcom says BCM5755 or higher and BCM5906 have short DMA bug.
  Apply workaround to these controllers.

r226807:
  BCM5719 cannot handle DMA requests for DMA segments that have
  larger than 4KB in size.  However the maximum DMA segment size
  created in DMA tag is 4KB, so we wouldn't encounter the issue here.
  Just record this issue such that let developers not to create a DMA
  segment that is larger than 4KB for BCM5719. It's possible to split
  a DMA segment into multiple smaller ones in run time but I believe
  it's not worth to implement that.

Revision 1.350.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 31 14:12:12 2011 UTC (5 weeks, 6 days ago) by hselasky
Branches: RELENG_9
Diff to: previous 1.350.2.1: preferred, colored; branchpoint 1.350: preferred, colored
Changes since revision 1.350.2.1: +1 -5 lines
SVN rev 229093 on 2011-12-31 14:12:12Z by hselasky

MFC r226173, r227843, r227848 and r227908:
Use DEVMETHOD_END to mark end of device methods.
Remove superfluous device methods.
Add some missing __FBSBID() macros.

Revision 1.369: download - view: text, markup, annotated - select for diffs
Tue Dec 13 20:31:57 2011 UTC (8 weeks, 2 days ago) by yongari
Branches: MAIN
Diff to: previous 1.368: preferred, colored
Changes since revision 1.368: +2 -0 lines
SVN rev 228480 on 2011-12-13 20:31:57Z by yongari

Destroy DMA tag for jumbo RX buffer in device detach.

Revision 1.368: download - view: text, markup, annotated - select for diffs
Tue Dec 13 20:26:46 2011 UTC (8 weeks, 2 days ago) by yongari
Branches: MAIN
Diff to: previous 1.367: preferred, colored
Changes since revision 1.367: +17 -3 lines
SVN rev 228479 on 2011-12-13 20:26:46Z by yongari

BCM5720 performance tweak from Broadcom.
 o Allow multiple outstanding read requests from non-LSO read DMA engine.
 o Allow 4KB burst length reads for non-LSO frames.
 o Enable 512B burst length reads for buffer descriptors.

Submitted by:	Geans Pin < geanspin <> broadcom dot com >

Revision 1.367: download - view: text, markup, annotated - select for diffs
Tue Nov 22 21:28:20 2011 UTC (2 months, 2 weeks ago) by marius
Branches: MAIN
Diff to: previous 1.366: preferred, colored
Changes since revision 1.366: +1 -5 lines
SVN rev 227843 on 2011-11-22 21:28:20Z by marius

- There's no need to overwrite the default device method with the default
  one. Interestingly, these are actually the default for quite some time
  (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
  since r52045) but even recently added device drivers do this unnecessarily.
  Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
  Discussed with: jhb
- Also while at it, use __FBSDID.

Revision 1.350.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (3 months ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.350.2.1: preferred, colored; next MAIN 1.350.2.2: preferred, colored
Changes since revision 1.350.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.366: download - view: text, markup, annotated - select for diffs
Mon Nov 7 15:43:11 2011 UTC (3 months ago) by ed
Branches: MAIN
Diff to: previous 1.365: preferred, colored
Changes since revision 1.365: +1 -1 lines
SVN rev 227309 on 2011-11-07 15:43:11Z by ed

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.

Revision 1.365: download - view: text, markup, annotated - select for diffs
Fri Oct 28 01:10:59 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.364: preferred, colored
Changes since revision 1.364: +24 -2 lines
SVN rev 226872 on 2011-10-28 01:10:59Z by yongari

Disable updating InputDiscards counter for BCM5717, BCM5718,
BCM5719 A0 and BCM5720 A0 and add comment why driver does not try
to read it.

Revision 1.364: download - view: text, markup, annotated - select for diffs
Fri Oct 28 01:04:40 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.363: preferred, colored
Changes since revision 1.363: +70 -19 lines
SVN rev 226871 on 2011-10-28 01:04:40Z by yongari

Add initial BCM5720 support.
Many thanks to Broadcom for continuing support of FreeBSD.

Submitted by:	Geans Pin at Broadcom (initial version)
H/W donated by:	Broadcom

Revision 1.363: download - view: text, markup, annotated - select for diffs
Thu Oct 27 22:10:52 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.362: preferred, colored
Changes since revision 1.362: +2 -1 lines
SVN rev 226867 on 2011-10-27 22:10:52Z by yongari

Define BGE_FW_HB_TIMEOUT_SEC and remove one more magic value.
bge(4) sends BGE_FW_CMD_DRV_ALIVE command to firmware every 2
seconds.  BGE_FW_CMD_DRV_ALIVE command requires 4 bytes data.  This
data contains timeout value in seconds until the next
BGE_FW_CMD_DRV_ALIVE command.
Broadcom recommends driver set the value 3 times longer than the
interval that it sends BGE_FW_CMD_DRV_ALIVE.  Currently bge(4) uses
3 seconds so probably we have to increase it in future and use
different ALIVE command(e.g. BGE_FW_CMD_DRV_ALIVE3).

No functional changes.

Revision 1.362: download - view: text, markup, annotated - select for diffs
Thu Oct 27 21:27:37 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.361: preferred, colored
Changes since revision 1.361: +5 -3 lines
SVN rev 226866 on 2011-10-27 21:27:37Z by yongari

Rename hard-coded value 1 << 14 with BGE_RX_CPU_DRV_EVENT.
This bit(SW event 7 in publicly available data sheet) is used to
make RX CPU handle a firmware command and the bit is automatically
cleared after RX CPU completed the command.
Generally firmware command takes the following steps.
 1. Write BGE_SRAM_FW_CMD_MB with a command.
 2. Write BGE_SRAM_FW_CMD_LEN_MB with the length of the command in bytes.
 3. Write BGE_SRAM_FW_CMD_DATA_MB with actual command data.
 4. Generate BGE_RX_CPU_EVENT and let firmware handle the command.
 5. Wait for the ACK of the firmware command.

No functional changes.

Revision 1.361: download - view: text, markup, annotated - select for diffs
Thu Oct 27 20:54:53 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.360: preferred, colored
Changes since revision 1.360: +2 -2 lines
SVN rev 226864 on 2011-10-27 20:54:53Z by yongari

Rename BGE_FW_DRV_ALIVE/BGE_FW_PAUSE to BGE_FW_CMD_DRV_ALIVE/BGE_FW_CMD_PAUSE.
Also add more firmware commands(not used yet).
No functional changes.

Revision 1.360: download - view: text, markup, annotated - select for diffs
Wed Oct 26 23:52:02 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.359: preferred, colored
Changes since revision 1.359: +12 -6 lines
SVN rev 226821 on 2011-10-26 23:52:02Z by yongari

SRAM offset 0x0C04 is used by driver to inform the IPMI/ASF firmware
about the various driver events like load, unload, reset, suspend,
restart, and ioctl operations.
Define driver's event rather than using hard-coded values.  We don't
still send suspend/resume event to firmware.

Previously bge(4) used BGE_SDI_STATUS to send events. Because driver
has to access firmware mail box to inform current state, using
BGE_SDI_STATUS register was wrong. The end result was the same as
BGE_SDI_STATUS is 0x0C04.

No functional changes.

Revision 1.359: download - view: text, markup, annotated - select for diffs
Wed Oct 26 23:22:32 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.358: preferred, colored
Changes since revision 1.358: +5 -5 lines
SVN rev 226820 on 2011-10-26 23:22:32Z by yongari

Offset 0x6810 is RX-RISC event register. Rename BGE_CPU_EVENT with
BGE_RX_CPU_EVENT for readability.
Additionally define BGE_TX_CPU_EVENT for TX-RSIC event register(BCM570[0-4] only).

Revision 1.358: download - view: text, markup, annotated - select for diffs
Wed Oct 26 21:11:40 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.357: preferred, colored
Changes since revision 1.357: +2 -2 lines
SVN rev 226815 on 2011-10-26 21:11:40Z by yongari

Define MAC address mail box and use it instead of using
hard-coded value.

Revision 1.357: download - view: text, markup, annotated - select for diffs
Wed Oct 26 21:05:45 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.356: preferred, colored
Changes since revision 1.356: +14 -14 lines
SVN rev 226814 on 2011-10-26 21:05:45Z by yongari

Rename definition of BGE_SOFTWARE_GENCOMM_* to more readable ones.
The origin of GENCOMM seems to come from Alteon Tigon Host/NIC
interface definition where it defines general communications region
which is active when firmware is loaded and running.  This region
was used in communication between the host and processor internal
to the Tigon chip.
Broadcom data sheet also defines the region as 'Software Gencomm'
in NetXtreme memory map but lacks detailed description of its
interface so it was hard to know which ones are used for which
interface.
This change shall slightly enhance readability.

No functional changes.

Revision 1.356: download - view: text, markup, annotated - select for diffs
Wed Oct 26 18:37:02 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.355: preferred, colored
Changes since revision 1.355: +9 -0 lines
SVN rev 226807 on 2011-10-26 18:37:02Z by yongari

BCM5719 cannot handle DMA requests for DMA segments that have
larger than 4KB in size.  However the maximum DMA segment size
created in DMA tag is 4KB, so we wouldn't encounter the issue here.
Just record this issue such that let developers not to create a DMA
segment that is larger than 4KB for BCM5719. It's possible to split
a DMA segment into multiple smaller ones in run time but I believe
it's not worth to implement that.

Revision 1.355: download - view: text, markup, annotated - select for diffs
Wed Oct 26 18:27:01 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.354: preferred, colored
Changes since revision 1.354: +4 -3 lines
SVN rev 226806 on 2011-10-26 18:27:01Z by yongari

Broadcom says BCM5755 or higher and BCM5906 have short DMA bug.
Apply workaround to these controllers.

Revision 1.354: download - view: text, markup, annotated - select for diffs
Wed Oct 26 18:19:50 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.353: preferred, colored
Changes since revision 1.353: +2 -4 lines
SVN rev 226805 on 2011-10-26 18:19:50Z by yongari

It is known that all Broadcom controllers have 4GB boundary DMA
bug.  Apply workaround to all controllers.

Revision 1.353: download - view: text, markup, annotated - select for diffs
Wed Oct 26 18:05:46 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.352: preferred, colored
Changes since revision 1.352: +2 -1 lines
SVN rev 226804 on 2011-10-26 18:05:46Z by yongari

Make CPMU handle GPHY power down control on controllers that have
CPMU capability.

Revision 1.352: download - view: text, markup, annotated - select for diffs
Wed Oct 26 01:03:53 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.351: preferred, colored
Changes since revision 1.351: +16 -7 lines
SVN rev 226770 on 2011-10-26 01:03:53Z by yongari

Fix long standing bge_sysctl_debug_info() issues.
 o Protect bge(4) status block access and register dump with driver lock.
 o Add missing bus_dmamap_sync() before dumping status block.
 o Use minimum status block size, 32 bytes, for status block dump on most
   controllers except BCM5700 AX/BX.
While I'm here, make the handler show 5717 Plus in hardware flags.

Revision 1.351: download - view: text, markup, annotated - select for diffs
Tue Oct 25 20:45:14 2011 UTC (3 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.350: preferred, colored
Changes since revision 1.350: +5 -5 lines
SVN rev 226749 on 2011-10-25 20:45:14Z by yongari

Whitespace nits.

Revision 1.350.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.350: preferred, colored
Changes since revision 1.350: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.226.2.58: download - view: text, markup, annotated - select for diffs
Sun Sep 11 20:38:33 2011 UTC (4 months, 4 weeks ago) by marius
Branches: RELENG_8
Diff to: previous 1.226.2.57: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.57: +2 -3 lines
SVN rev 225492 on 2011-09-11 20:38:33Z by marius

MFC: r221407 (partial)

- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Add a PHY-specific reset routine is for lxtphy(4) which disables MII
  interrupts.
- Remove redundant checks in NIC drivers for mii->mii_instance not being
  zero before calling the reset routines because as soon as one PHY driver
  attaches mii->mii_instance is incremented and we hardly can end up in
  their media change callbacks etc if no PHY driver has attached as
  mii_attach() would have failed in that case and not attach a miibus(4)
  instance.
- Convert the mebers of the MII data structure to unsigned where
  appropriate. This is partly inspired by NetBSD/OpenBSD.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
  weren't explicitly converted to support flow control before. It's
  unclear whether flow control actually works with these but typically
  it should and their net behavior should be more correct with these
  changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from:	NetBSD (partially)

Revision 1.198.2.74: download - view: text, markup, annotated - select for diffs
Sun Sep 11 20:25:57 2011 UTC (4 months, 4 weeks ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.73: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.73: +2 -3 lines
SVN rev 225490 on 2011-09-11 20:25:57Z by marius

MFC: r221407 (partial)

- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Add a PHY-specific reset routine is for lxtphy(4) which disables MII
  interrupts.
- Remove redundant checks in NIC drivers for mii->mii_instance not being
  zero before calling the reset routines because as soon as one PHY driver
  attaches mii->mii_instance is incremented and we hardly can end up in
  their media change callbacks etc if no PHY driver has attached as
  mii_attach() would have failed in that case and not attach a miibus(4)
  instance.
- Convert the mebers of the MII data structure to unsigned where
  appropriate. This is partly inspired by NetBSD/OpenBSD.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
  weren't explicitly converted to support flow control before. It's
  unclear whether flow control actually works with these but typically
  it should and their net behavior should be more correct with these
  changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from:	NetBSD (partially)

Revision 1.198.2.73: download - view: text, markup, annotated - select for diffs
Mon Jul 25 17:14:55 2011 UTC (6 months, 2 weeks ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.72: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.72: +2 -2 lines
SVN rev 224341 on 2011-07-25 17:14:55Z by marius

MFC: r221344

Correct spelling in comments.

Submitted by:	brucec

Revision 1.226.2.57: download - view: text, markup, annotated - select for diffs
Mon Jul 25 17:14:49 2011 UTC (6 months, 2 weeks ago) by marius
Branches: RELENG_8
Diff to: previous 1.226.2.56: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.56: +2 -2 lines
SVN rev 224340 on 2011-07-25 17:14:49Z by marius

MFC: r221344

Correct spelling in comments.

Submitted by:	brucec

Revision 1.198.2.72: download - view: text, markup, annotated - select for diffs
Wed Jun 22 00:22:26 2011 UTC (7 months, 2 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.71: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.71: +1 -1 lines
SVN rev 223390 on 2011-06-22 00:22:26Z by yongari

MFC r221974:
  Correctly disable jumbo frame support for BCM5719 A0.

Revision 1.226.2.56: download - view: text, markup, annotated - select for diffs
Wed Jun 22 00:21:19 2011 UTC (7 months, 2 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.55: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.55: +1 -1 lines
SVN rev 223389 on 2011-06-22 00:21:19Z by yongari

MFC r221974:
  Correctly disable jumbo frame support for BCM5719 A0.

Revision 1.198.2.71: download - view: text, markup, annotated - select for diffs
Wed Jun 22 00:17:48 2011 UTC (7 months, 2 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.70: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.70: +73 -12 lines
SVN rev 223388 on 2011-06-22 00:17:48Z by yongari

MFC r221818:
  Add initial BCM5719 support. TSO and jumbo frame was intentionally
  disabled for BCM5719 A0 revision due to known hardware errata.
  Many thanks to Broadcom for continuing support of FreeBSD.

  Submitted by:	Geans Pin at Broadcom

Revision 1.226.2.55: download - view: text, markup, annotated - select for diffs
Wed Jun 22 00:16:40 2011 UTC (7 months, 2 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.54: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.54: +73 -12 lines
SVN rev 223387 on 2011-06-22 00:16:40Z by yongari

MFC r221818:
  Add initial BCM5719 support. TSO and jumbo frame was intentionally
  disabled for BCM5719 A0 revision due to known hardware errata.
  Many thanks to Broadcom for continuing support of FreeBSD.

  Submitted by:	Geans Pin at Broadcom

Revision 1.198.2.70: download - view: text, markup, annotated - select for diffs
Fri May 27 18:47:48 2011 UTC (8 months, 2 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.69: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.69: +47 -34 lines
SVN rev 222370 on 2011-05-27 18:47:48Z by yongari

MFC r221712:
  Since r117657, bge(4) does not enable buffer manager for BCM5705 or
  newer controllers.  However, all data sheet I have access has no
  indication that buffer manager should not be touched on these
  controllers.  It seems the buffer manager always runs on BCM5705 or
  newer controllers. Some controller(e.g. BCM5719) needs other buffer
  manager configuration so driver should enable buffer manager for
  all controllers.  Both Linux and OpenBSD/NetBSD use the same
  approach.
  This change polls enable bit of block to know whether specified
  block was really stopped as well as enabling buffer manager for all
  controllers in driver initialization.

  Obtained from:	NetBSD

Revision 1.226.2.54: download - view: text, markup, annotated - select for diffs
Fri May 27 18:46:24 2011 UTC (8 months, 2 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.53: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.53: +47 -34 lines
SVN rev 222369 on 2011-05-27 18:46:24Z by yongari

MFC r221712:
  Since r117657, bge(4) does not enable buffer manager for BCM5705 or
  newer controllers.  However, all data sheet I have access has no
  indication that buffer manager should not be touched on these
  controllers.  It seems the buffer manager always runs on BCM5705 or
  newer controllers. Some controller(e.g. BCM5719) needs other buffer
  manager configuration so driver should enable buffer manager for
  all controllers.  Both Linux and OpenBSD/NetBSD use the same
  approach.
  This change polls enable bit of block to know whether specified
  block was really stopped as well as enabling buffer manager for all
  controllers in driver initialization.

  Obtained from:	NetBSD

Revision 1.198.2.69: download - view: text, markup, annotated - select for diffs
Fri May 20 20:31:36 2011 UTC (8 months, 3 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.68: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.68: +6 -6 lines
SVN rev 222147 on 2011-05-20 20:31:36Z by yongari

MFC r221468:
  Enable Ethernet@WireSpeed for BCM5718/BCM57765 family. While I'm
  here inverse meaning of PHY flag as Ethernet@WireSpeed is enabled
  for most PHYs.

Revision 1.226.2.53: download - view: text, markup, annotated - select for diffs
Fri May 20 20:29:50 2011 UTC (8 months, 3 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.52: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.52: +6 -6 lines
SVN rev 222146 on 2011-05-20 20:29:50Z by yongari

MFC r221468:
  Enable Ethernet@WireSpeed for BCM5718/BCM57765 family. While I'm
  here inverse meaning of PHY flag as Ethernet@WireSpeed is enabled
  for most PHYs.

Revision 1.198.2.68: download - view: text, markup, annotated - select for diffs
Fri May 20 20:27:25 2011 UTC (8 months, 3 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.67: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.67: +47 -6 lines
SVN rev 222145 on 2011-05-20 20:27:25Z by yongari

MFC r221445:
  Add initial BCM57765 family support. The BCM57765 family seems to
  have similar hardware features of BCM5718 family except the number
  of receive return ring is 4. The BCM57765 family is known to
  support IEEE 802.3az EEE(Energy Efficient Ethernet) but this change
  does not include EEE support code. I hope EEE is implemented in
  near future.
  This change will support BCM57761, BCM57765, BCM57781, BCM57785,
  BCM57791 and BCM57795. All hardware offloading features are
  supported and suspend/resume also should work.
  Many thanks to Broadcom for continuing support of FreeBSD.

  Tested by:	Paul Thornton (prt <> prt dot org)
  HW donated by:	Broadcom

Revision 1.226.2.52: download - view: text, markup, annotated - select for diffs
Fri May 20 20:26:16 2011 UTC (8 months, 3 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.51: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.51: +47 -6 lines
SVN rev 222144 on 2011-05-20 20:26:16Z by yongari

MFC r221445:
  Add initial BCM57765 family support. The BCM57765 family seems to
  have similar hardware features of BCM5718 family except the number
  of receive return ring is 4. The BCM57765 family is known to
  support IEEE 802.3az EEE(Energy Efficient Ethernet) but this change
  does not include EEE support code. I hope EEE is implemented in
  near future.
  This change will support BCM57761, BCM57765, BCM57781, BCM57785,
  BCM57791 and BCM57795. All hardware offloading features are
  supported and suspend/resume also should work.
  Many thanks to Broadcom for continuing support of FreeBSD.

  Tested by:	Paul Thornton (prt <> prt dot org)
  HW donated by:	Broadcom

Revision 1.350: download - view: text, markup, annotated - select for diffs
Sun May 15 21:44:51 2011 UTC (8 months, 3 weeks ago) by yongari
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.349: preferred, colored
Changes since revision 1.349: +1 -1 lines
SVN rev 221974 on 2011-05-15 21:44:51Z by yongari

Correctly disable jumbo frame support for BCM5719 A0.

Revision 1.349: download - view: text, markup, annotated - select for diffs
Thu May 12 17:15:57 2011 UTC (9 months ago) by yongari
Branches: MAIN
Diff to: previous 1.348: preferred, colored
Changes since revision 1.348: +73 -12 lines
SVN rev 221818 on 2011-05-12 17:15:57Z by yongari

Add initial BCM5719 support. TSO and jumbo frame was intentionally
disabled for BCM5719 A0 revision due to known hardware errata.
Many thanks to Broadcom for continuing support of FreeBSD.

Submitted by:	Geans Pin at Broadcom

Revision 1.348: download - view: text, markup, annotated - select for diffs
Mon May 9 20:10:46 2011 UTC (9 months ago) by yongari
Branches: MAIN
Diff to: previous 1.347: preferred, colored
Changes since revision 1.347: +47 -34 lines
SVN rev 221712 on 2011-05-09 20:10:46Z by yongari

Since r117657, bge(4) does not enable buffer manager for BCM5705 or
newer controllers.  However, all data sheet I have access has no
indication that buffer manager should not be touched on these
controllers.  It seems the buffer manager always runs on BCM5705 or
newer controllers. Some controller(e.g. BCM5719) needs other buffer
manager configuration so driver should enable buffer manager for
all controllers.  Both Linux and OpenBSD/NetBSD use the same
approach.
This change polls enable bit of block to know whether specified
block was really stopped as well as enabling buffer manager for all
controllers in driver initialization.

Obtained from:	NetBSD

Revision 1.198.2.67: download - view: text, markup, annotated - select for diffs
Fri May 6 20:02:26 2011 UTC (9 months ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.66: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.66: +1 -1 lines
SVN rev 221545 on 2011-05-06 20:02:26Z by marius

MFC: r221343

Fix an logic bug which caused jumbo buffers to not be synced and unloaded.
Reported and tested by: Michael Moll

Revision 1.226.2.51: download - view: text, markup, annotated - select for diffs
Fri May 6 20:02:23 2011 UTC (9 months ago) by marius
Branches: RELENG_8
Diff to: previous 1.226.2.50: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.50: +1 -1 lines
SVN rev 221544 on 2011-05-06 20:02:23Z by marius

MFC: r221343

Fix an logic bug which caused jumbo buffers to not be synced and unloaded.
Reported and tested by: Michael Moll

Revision 1.347: download - view: text, markup, annotated - select for diffs
Thu May 5 00:43:40 2011 UTC (9 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.346: preferred, colored
Changes since revision 1.346: +6 -6 lines
SVN rev 221468 on 2011-05-05 00:43:40Z by yongari

Enable Ethernet@WireSpeed for BCM5718/BCM57765 family. While I'm
here inverse meaning of PHY flag as Ethernet@WireSpeed is enabled
for most PHYs.

Revision 1.346: download - view: text, markup, annotated - select for diffs
Wed May 4 17:04:31 2011 UTC (9 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.345: preferred, colored
Changes since revision 1.345: +47 -6 lines
SVN rev 221445 on 2011-05-04 17:04:31Z by yongari

Add initial BCM57765 family support. The BCM57765 family seems to
have similar hardware features of BCM5718 family except the number
of receive return ring is 4. The BCM57765 family is known to
support IEEE 802.3az EEE(Energy Efficient Ethernet) but this change
does not include EEE support code. I hope EEE is implemented in
near future.
This change will support BCM57761, BCM57765, BCM57781, BCM57785,
BCM57791 and BCM57795. All hardware offloading features are
supported and suspend/resume also should work.
Many thanks to Broadcom for continuing support of FreeBSD.

Tested by:	Paul Thornton (prt <> prt dot org)
HW donated by:	Broadcom

Revision 1.345: download - view: text, markup, annotated - select for diffs
Tue May 3 19:51:29 2011 UTC (9 months, 1 week ago) by marius
Branches: MAIN
Diff to: previous 1.344: preferred, colored
Changes since revision 1.344: +2 -3 lines
SVN rev 221407 on 2011-05-03 19:51:29Z by marius

- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP
  (reporting IFM_LOOP based on BMCR_LOOP is left in place though as
  it might provide useful for debugging). For most mii(4) drivers it
  was unclear whether the PHYs driven by them actually support
  loopback or not. Moreover, typically loopback mode also needs to
  be activated on the MAC, which none of the Ethernet drivers using
  mii(4) implements. Given that loopback media has no real use (and
  obviously hardly had a chance to actually work) besides for driver
  development (which just loopback mode should be sufficient for
  though, i.e one doesn't necessary need support for loopback media)
  support for it is just dropped as both NetBSD and OpenBSD already
  did quite some time ago.
- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Restructure the PHY entry points to use a structure of entry points
  instead of discrete function pointers, and extend this to include
  a "reset" entry point. Make sure any PHY-specific reset routine is
  always used, and provide one for lxtphy(4) which disables MII
  interrupts (as is done for a few other PHYs we have drivers for).
  This includes changing NIC drivers which previously just called the
  generic mii_phy_reset() to now actually call the PHY-specific reset
  routine, which might be crucial in some cases. While at it, the
  redundant checks in these NIC drivers for mii->mii_instance not being
  zero before calling the reset routines were removed because as soon
  as one PHY driver attaches mii->mii_instance is incremented and we
  hardly can end up in their media change callbacks etc if no PHY driver
  has attached as mii_attach() would have failed in that case and not
  attach a miibus(4) instance.
  Consequently, NIC drivers now no longer should call mii_phy_reset()
  directly, so it was removed from EXPORT_SYMS.
- Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe().
  The purpose of that function is to perform the common steps to attach
  a PHY driver instance and to hook it up to the miibus(4) instance and to
  optionally also handle the probing, addition and initialization of the
  supported media. So all a PHY driver without any special requirements
  has to do in its bus attach method is to call mii_phy_dev_attach()
  along with PHY-specific MIIF_* flags, a pointer to its PHY functions
  and the add_media set to one. All PHY drivers were updated to take
  advantage of mii_phy_dev_attach() as appropriate. Along with these
  changes the capability mask was added to the mii_softc structure so
  PHY drivers taking advantage of mii_phy_dev_attach() but still
  handling media on their own do not need to fiddle with the MII attach
  arguments anyway.
- Keep track of the PHY offset in the mii_softc structure. This is done
  for compatibility with NetBSD/OpenBSD.
- Keep track of the PHY's OUI, model and revision in the mii_softc
  structure. Several PHY drivers require this information also after
  attaching and previously had to wrap their own softc around mii_softc.
  NetBSD/OpenBSD also keep track of the model and revision on their
  mii_softc structure. All PHY drivers were updated to take advantage
  as appropriate.
- Convert the mebers of the MII data structure to unsigned where
  appropriate. This is partly inspired by NetBSD/OpenBSD.
- According to IEEE 802.3-2002 the bits actually have to be reversed
  when mapping an OUI to the MII ID registers. All PHY drivers and
  miidevs where changed as necessary. Actually this now again allows to
  largely share miidevs with NetBSD, which fixed this problem already
  9 years ago. Consequently miidevs was synced as far as possible.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
  weren't explicitly converted to support flow control before. It's
  unclear whether flow control actually works with these but typically
  it should and their net behavior should be more correct with these
  changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from:	NetBSD (partially)
Reviewed by:	yongari (earlier version), silence on arch@ and net@

Revision 1.198.2.66: download - view: text, markup, annotated - select for diffs
Mon May 2 22:52:22 2011 UTC (9 months, 1 week ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.65: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.65: +37 -17 lines
SVN rev 221352 on 2011-05-02 22:52:22Z by yongari

MFC r220368:
  Add initial jumbo frame support for BCM5714/BCM5715 and BCM5780.
  Unlike other controllers which have more advanced jumbo support,
  these controllers have one send ring, one standard receive producer
  ring and one receive return ring. In order to receive jumbo frames
  on the controllers, driver now will increase Rx buffer size to 9k.
  Two Rx modes are supported on these controllers and I chose
  standard Rx BDs over extended Rx BDs. The extended Rx BD mode
  allows up to 4 segmentations for each Rx BDs such that kernel does
  not have to allocate large buffer of contiguous memory for
  receiving. The extended Rx BD mode is already used on controllers
  that have separate jumbo receive ring. However, using extended Rx
  BDs on BCM5714/BCM5715/BCM5780 reduces the number of Rx BDs to 256
  entries which in turn may reduce the performance.  Also UMA backed
  page allocator for jumbo frame returns contiguous memory so using
  extended Rx BD has no advantage on FreeBSD unless highly customized
  local allocator implemented in driver is used.
  To use jumbo buffers in standard receive ring, Rx buffer allocation
  handler was changed to allocate MJUM9BYTES sized mbuf.

  PR:		kern/155192
  Tested by:	Vijay Singh <vijju.singh <> gmail dot com>
  Submitted by:	mjacob (initial version)

Revision 1.226.2.50: download - view: text, markup, annotated - select for diffs
Mon May 2 22:49:43 2011 UTC (9 months, 1 week ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.49: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.49: +37 -17 lines
SVN rev 221351 on 2011-05-02 22:49:43Z by yongari

MFC r220368:
  Add initial jumbo frame support for BCM5714/BCM5715 and BCM5780.
  Unlike other controllers which have more advanced jumbo support,
  these controllers have one send ring, one standard receive producer
  ring and one receive return ring. In order to receive jumbo frames
  on the controllers, driver now will increase Rx buffer size to 9k.
  Two Rx modes are supported on these controllers and I chose
  standard Rx BDs over extended Rx BDs. The extended Rx BD mode
  allows up to 4 segmentations for each Rx BDs such that kernel does
  not have to allocate large buffer of contiguous memory for
  receiving. The extended Rx BD mode is already used on controllers
  that have separate jumbo receive ring. However, using extended Rx
  BDs on BCM5714/BCM5715/BCM5780 reduces the number of Rx BDs to 256
  entries which in turn may reduce the performance.  Also UMA backed
  page allocator for jumbo frame returns contiguous memory so using
  extended Rx BD has no advantage on FreeBSD unless highly customized
  local allocator implemented in driver is used.
  To use jumbo buffers in standard receive ring, Rx buffer allocation
  handler was changed to allocate MJUM9BYTES sized mbuf.

  PR:		kern/155192
  Tested by:	Vijay Singh <vijju.singh <> gmail dot com>
  Submitted by:	mjacob (initial version)

Revision 1.344: download - view: text, markup, annotated - select for diffs
Mon May 2 21:04:23 2011 UTC (9 months, 1 week ago) by marius
Branches: MAIN
Diff to: previous 1.343: preferred, colored
Changes since revision 1.343: +2 -2 lines
SVN rev 221344 on 2011-05-02 21:04:23Z by marius

Correct spelling in comments.

Submitted by:	brucec

Revision 1.343: download - view: text, markup, annotated - select for diffs
Mon May 2 20:45:19 2011 UTC (9 months, 1 week ago) by marius
Branches: MAIN
Diff to: previous 1.342: preferred, colored
Changes since revision 1.342: +1 -1 lines
SVN rev 221343 on 2011-05-02 20:45:19Z by marius

Fix an logic bug which caused jumbo buffers to not be synced.
Reported and tested by: Michael Moll

MFC after:	3 days

Revision 1.342: download - view: text, markup, annotated - select for diffs
Tue Apr 5 17:41:54 2011 UTC (10 months ago) by yongari
Branches: MAIN
Diff to: previous 1.341: preferred, colored
Changes since revision 1.341: +37 -17 lines
SVN rev 220368 on 2011-04-05 17:41:54Z by yongari

Add initial jumbo frame support for BCM5714/BCM5715 and BCM5780.
Unlike other controllers which have more advanced jumbo support,
these controllers have one send ring, one standard receive producer
ring and one receive return ring. In order to receive jumbo frames
on the controllers, driver now will increase Rx buffer size to 9k.
Two Rx modes are supported on these controllers and I chose
standard Rx BDs over extended Rx BDs. The extended Rx BD mode
allows up to 4 segmentations for each Rx BDs such that kernel does
not have to allocate large buffer of contiguous memory for
receiving. The extended Rx BD mode is already used on controllers
that have separate jumbo receive ring. However, using extended Rx
BDs on BCM5714/BCM5715/BCM5780 reduces the number of Rx BDs to 256
entries which in turn may reduce the performance.  Also UMA backed
page allocator for jumbo frame returns contiguous memory so using
extended Rx BD has no advantage on FreeBSD unless highly customized
local allocator implemented in driver is used.
To use jumbo buffers in standard receive ring, Rx buffer allocation
handler was changed to allocate MJUM9BYTES sized mbuf.

PR:		kern/155192
Tested by:	Vijay Singh <vijju.singh <> gmail dot com>
Submitted by:	mjacob (initial version)

Revision 1.341: download - view: text, markup, annotated - select for diffs
Wed Mar 23 13:10:15 2011 UTC (10 months, 2 weeks ago) by jhb
Branches: MAIN
Diff to: previous 1.340: preferred, colored
Changes since revision 1.340: +3 -3 lines
SVN rev 219902 on 2011-03-23 13:10:15Z by jhb

Do a sweep of the tree replacing calls to pci_find_extcap() with calls to
pci_find_cap() instead.

Revision 1.340: download - view: text, markup, annotated - select for diffs
Wed Jan 12 19:53:56 2011 UTC (12 months, 4 weeks ago) by mdf
Branches: MAIN
Diff to: previous 1.339: preferred, colored
Changes since revision 1.339: +1 -1 lines
SVN rev 217323 on 2011-01-12 19:53:56Z by mdf

sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.

Commit the rest of the devices.

Revision 1.198.2.63.2.2: download - view: text, markup, annotated - select for diffs
Mon Jan 10 19:59:20 2011 UTC (13 months ago) by yongari
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.198.2.63.2.1: preferred, colored; branchpoint 1.198.2.63: preferred, colored; next MAIN 1.198.2.64: preferred, colored
Changes since revision 1.198.2.63.2.1: +11 -1 lines
SVN rev 217235 on 2011-01-10 19:59:20Z by yongari

MFC r217226:
  Apply DMA address space restriction to controllers that have 4GB
  DMA boundary bug and runs with PCI-X mode.  watchdog timeout was
  observed on BCM5704 which lives behind certain PCI-X bridge(e.g.
  AMD 8131 PCI-X bridge).  It's still not clear whether the root
  cause came from that PCI-X bridge or not. The watchdog timeout
  indicates the issue is in TX path. If the bridge reorders TX
  mailbox write accesses it would generate all kinds of problems but
  I'm not sure.  This should be revisited.

  Early MFC requested by re@ for inclusion in 8.2-RC2/7.4-RC2.

  Tested by:	Michael L. Squires (mikes <> siralan dot org)
  Approved by:	re (kensmith)

Revision 1.226.2.47.2.2: download - view: text, markup, annotated - select for diffs
Mon Jan 10 19:55:30 2011 UTC (13 months ago) by yongari
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.226.2.47.2.1: preferred, colored; branchpoint 1.226.2.47: preferred, colored; next MAIN 1.226.2.48: preferred, colored
Changes since revision 1.226.2.47.2.1: +11 -1 lines
SVN rev 217233 on 2011-01-10 19:55:30Z by yongari

MFC r217226:
  Apply DMA address space restriction to controllers that have 4GB
  DMA boundary bug and runs with PCI-X mode.  watchdog timeout was
  observed on BCM5704 which lives behind certain PCI-X bridge(e.g.
  AMD 8131 PCI-X bridge).  It's still not clear whether the root
  cause came from that PCI-X bridge or not. The watchdog timeout
  indicates the issue is in TX path. If the bridge reorders TX
  mailbox write accesses it would generate all kinds of problems but
  I'm not sure.  This should be revisited.

  Early MFC requested by re@ for inclusion in 8.2-RC2/7.4-RC2.

  Tested by:	Michael L. Squires (mikes <> siralan dot org)
  Approved by:	re (kensmith)

Revision 1.198.2.65: download - view: text, markup, annotated - select for diffs
Mon Jan 10 19:48:24 2011 UTC (13 months ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.64: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.64: +11 -1 lines
SVN rev 217231 on 2011-01-10 19:48:24Z by yongari

MFC r217226:
  Apply DMA address space restriction to controllers that have 4GB
  DMA boundary bug and runs with PCI-X mode.  watchdog timeout was
  observed on BCM5704 which lives behind certain PCI-X bridge(e.g.
  AMD 8131 PCI-X bridge).  It's still not clear whether the root
  cause came from that PCI-X bridge or not. The watchdog timeout
  indicates the issue is in TX path. If the bridge reorders TX
  mailbox write accesses it would generate all kinds of problems but
  I'm not sure.  This should be revisited.

  Early MFC requested by re@ for inclusion in 8.2-RC2/7.4-RC2.

  Tested by:	Michael L. Squires (mikes <> siralan dot org)

Revision 1.226.2.49: download - view: text, markup, annotated - select for diffs
Mon Jan 10 19:43:16 2011 UTC (13 months ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.48: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.48: +11 -1 lines
SVN rev 217230 on 2011-01-10 19:43:16Z by yongari

MFC r217226:
  Apply DMA address space restriction to controllers that have 4GB
  DMA boundary bug and runs with PCI-X mode.  watchdog timeout was
  observed on BCM5704 which lives behind certain PCI-X bridge(e.g.
  AMD 8131 PCI-X bridge).  It's still not clear whether the root
  cause came from that PCI-X bridge or not. The watchdog timeout
  indicates the issue is in TX path. If the bridge reorders TX
  mailbox write accesses it would generate all kinds of problems but
  I'm not sure.  This should be revisited.

  Early MFC requested by re@ for inclusion in 8.2-RC2/7.4-RC2.

  Tested by:	Michael L. Squires (mikes <> siralan dot org)

Revision 1.339: download - view: text, markup, annotated - select for diffs
Mon Jan 10 17:45:09 2011 UTC (13 months ago) by yongari
Branches: MAIN
Diff to: previous 1.338: preferred, colored
Changes since revision 1.338: +11 -1 lines
SVN rev 217226 on 2011-01-10 17:45:09Z by yongari

Apply DMA address space restriction to controllers that have 4GB
DMA boundary bug and runs with PCI-X mode.  watchdog timeout was
observed on BCM5704 which lives behind certain PCI-X bridge(e.g.
AMD 8131 PCI-X bridge).  It's still not clear whether the root
cause came from that PCI-X bridge or not. The watchdog timeout
indicates the issue is in TX path. If the bridge reorders TX
mailbox write accesses it would generate all kinds of problems but
I'm not sure.  This should be revisited.

Tested by:	Michael L. Squires (mikes <> siralan dot org)

Revision 1.338: download - view: text, markup, annotated - select for diffs
Mon Jan 10 17:37:49 2011 UTC (13 months ago) by yongari
Branches: MAIN
Diff to: previous 1.337: preferred, colored
Changes since revision 1.337: +1 -11 lines
SVN rev 217225 on 2011-01-10 17:37:49Z by yongari

Backout r216973 and r216970. r216973 didn't solve watchdog timeout
issue seen on PCIX BCM5704 controller. r216970 fixed the issue but
the DMA address space restriction was applied to all bge(4)
controllers such that it caused unnecessary performance degradation
for controllers that have no such issues.

Revision 1.226.2.48: download - view: text, markup, annotated - select for diffs
Wed Jan 5 11:43:17 2011 UTC (13 months ago) by marius
Branches: RELENG_8
Diff to: previous 1.226.2.47: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.47: +19 -47 lines
SVN rev 216991 on 2011-01-05 11:43:17Z by marius

MFC: r216085

- Remove the remaining support for older (in this case pre-7.0-RELEASE)
  versions of FreeBSD. In fact we are already missing a lot of conditional
  code necessary to support older versions of FreeBSD, including alternatives
  for vital functionality not yet provided by the respective subsystem back
  then (see for example r199663). So this change shouldn't actually break
  this driver on versions of FreeBSD that were supported before. Besides,
  this driver also isn't maintained as an multi-release version outside of
  the main repository, so removing the conditional code shouldn't be a
  problem in that regard either.
- Sprinkle some more const on tables.

Revision 1.198.2.64: download - view: text, markup, annotated - select for diffs
Wed Jan 5 11:43:17 2011 UTC (13 months ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.63: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.63: +19 -47 lines
SVN rev 216992 on 2011-01-05 11:43:17Z by marius

MFC: r216085

- Remove the remaining support for older (in this case pre-7.0-RELEASE)
  versions of FreeBSD. In fact we are already missing a lot of conditional
  code necessary to support older versions of FreeBSD, including alternatives
  for vital functionality not yet provided by the respective subsystem back
  then (see for example r199663). So this change shouldn't actually break
  this driver on versions of FreeBSD that were supported before. Besides,
  this driver also isn't maintained as an multi-release version outside of
  the main repository, so removing the conditional code shouldn't be a
  problem in that regard either.
- Sprinkle some more const on tables.

Revision 1.337: download - view: text, markup, annotated - select for diffs
Tue Jan 4 20:06:26 2011 UTC (13 months ago) by yongari
Branches: MAIN
Diff to: previous 1.336: preferred, colored
Changes since revision 1.336: +4 -1 lines
SVN rev 216973 on 2011-01-04 20:06:26Z by yongari

Limit hardware bug workaround to controllers that have 4GB boundary
bug instead of blindly applying it to all controllers.

Pointed out by:	marius
MFC after:	3 days

Revision 1.336: download - view: text, markup, annotated - select for diffs
Tue Jan 4 19:10:54 2011 UTC (13 months ago) by yongari
Branches: MAIN
Diff to: previous 1.335: preferred, colored
Changes since revision 1.335: +8 -1 lines
SVN rev 216970 on 2011-01-04 19:10:54Z by yongari

Partially revert change made in r212061. r212061 relied on
bus_dma(9)'s capability which honors boundary restrictions of DMA
tag for dynamic buffers. However it seems this does not work well
and it triggered watchodg timeouts on controller that has the
hardware bug. It's not clear whether there is still another
hardware bug not mentioned in errata. This should be revisited
since this change shall make use of bounce buffers which in turn
reduces performance a lot on systems that have more than 4GB
memory.

Reported by:	Michael L. Squires (mikes <> siralan dot org)
Tested by:	Michael L. Squires (mikes <> siralan dot org)
MFC after:	3 days

Revision 1.198.2.63.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
Diff to: previous 1.198.2.63: preferred, colored
Changes since revision 1.198.2.63: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.226.2.47.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
Diff to: previous 1.226.2.47: preferred, colored
Changes since revision 1.226.2.47: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.335: download - view: text, markup, annotated - select for diffs
Tue Nov 30 21:08:59 2010 UTC (14 months, 1 week ago) by marius
Branches: MAIN
Diff to: previous 1.334: preferred, colored
Changes since revision 1.334: +19 -47 lines
SVN rev 216085 on 2010-11-30 21:08:59Z by marius

- Remove the remaining support for older (in this case pre-7.0-RELEASE)
  versions of FreeBSD. In fact we are already missing a lot of conditional
  code necessary to support older versions of FreeBSD, including alternatives
  for vital functionality not yet provided by the respective subsystem back
  then (see for example r199663). So this change shouldn't actually break
  this driver on versions of FreeBSD that were supported before. Besides,
  this driver also isn't maintained as an multi-release version outside of
  the main repository, so removing the conditional code shouldn't be a
  problem in that regard either.
- Sprinkle some more const on tables.

Revision 1.198.2.63: download - view: text, markup, annotated - select for diffs
Fri Nov 26 20:55:59 2010 UTC (14 months, 2 weeks ago) by marius
Branches: RELENG_7
CVS tags: RELENG_7_4_BP
Branch point for: RELENG_7_4
Diff to: previous 1.198.2.62: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.62: +23 -5 lines
SVN rev 215885 on 2010-11-26 20:55:59Z by marius

MFC: r215302

Move the limiting of the PHY to 10/100 modes of operation due to limitations
of certain MAC models from brgphy(4) to bge(4) where it belongs. While at it,
update the list of models having that restriction to what OpenBSD uses, which
in turn seems to have obtained that information from the Linux tg3 driver.

Revision 1.226.2.47: download - view: text, markup, annotated - select for diffs
Fri Nov 26 20:55:58 2010 UTC (14 months, 2 weeks ago) by marius
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.226.2.46: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.46: +23 -5 lines
SVN rev 215884 on 2010-11-26 20:55:58Z by marius

MFC: r215302

Move the limiting of the PHY to 10/100 modes of operation due to limitations
of certain MAC models from brgphy(4) to bge(4) where it belongs. While at it,
update the list of models having that restriction to what OpenBSD uses, which
in turn seems to have obtained that information from the Linux tg3 driver.

Revision 1.226.2.46: download - view: text, markup, annotated - select for diffs
Fri Nov 26 20:37:19 2010 UTC (14 months, 2 weeks ago) by marius
Branches: RELENG_8
Diff to: previous 1.226.2.45: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.45: +6 -4 lines
SVN rev 215881 on 2010-11-26 20:37:19Z by marius

MFC: r214608, r215297(partial), r215713

o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control
  support in mii(4):
  - Merge generic flow control advertisement (which can be enabled by
    passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from
    NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD,
    IFM_FLOW isn't implemented as a global option via the "don't care
    mask" but instead as a media specific option this. This has the
    following advantages:
    o allows flow control advertisement with autonegotiation to be
      turned on and off via ifconfig(8) with the default typically
      being off (though MIIF_FORCEPAUSE has been added causing flow
      control to be always advertised, allowing to easily MFC this
      changes for drivers that previously used home-grown support for
      flow control that behaved that way without breaking POLA)
    o allows to deal with PHY drivers where flow control advertisement
      with manual selection doesn't work or at least isn't implemented,
      like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4),
      by setting MIIF_NOMANPAUSE
    o the available combinations of media options are readily available
      from the `ifconfig -m` output
  - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE
    and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so
    these are understood by ifconfig(8).
o Make the master/slave support in mii(4) actually usable:
  - Change IFM_ETH_MASTER from being implemented as a global option via
    the "don't care mask" to a media specific one as it actually is only
    applicable to IFM_1000_T to date.
  - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to
    actually configure manually selected slave mode (like we also do in
    the PHY specific implementations).
  - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it
    is understood by ifconfig(8).
o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4),
  e1000phy(4) and ip1000phy(4) to use the generic flow control support
  instead of home-grown solutions via IFM_FLAGs. This includes changing
  these PHY drivers and smcphy(4) to no longer unconditionally advertise
  support for flow control but only if the selected media has IFM_FLOW
  set (or MIIF_FORCEPAUSE is set) and implemented for these media variants,
  i.e. typically only for copper.
o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and
  set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0
  and some IFM_FLAGn.
o Switch brgphy(4) to add at least the the supported copper media based on
  the contents of the BMSR via mii_phy_add_media() instead of hardcoding
  them. The latter approach seems to have developed historically, besides
  causing unnecessary code duplication it was also undesirable because
  brgphy_mii_phy_auto() already based the capability advertisement on the
  contents of the BMSR though.
o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not
  just BCM5701. Apparently this was a misinterpretation of a workaround
  in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and
  BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but
  this doesn't mean we can't set these as well on other PHYs for manual
  media selection.
o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so
  IFM_1000_T master mode support now is generally available with all PHY
  drivers.
o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's
  not applicable there.

Reviewed by:	yongari (plus additional testing)
Obtained from:	NetBSD (partially), OpenBSD (partially)

Unlike as in head, bge(4), bce(4), msk(4), nfe(4) and stge(4) are changed
to set MIIF_FORCEPAUSE in stable/8 so they continue to always advertise
support of flow control and brgphy(4), ciphy(4), e1000phy(4) as well as
ip1000phy(4) are changed to still also accept IFF_LINK0 in addition to
the master media option for setting master mode, both in order to not
violate POLA.

Revision 1.198.2.62: download - view: text, markup, annotated - select for diffs
Fri Nov 26 19:48:27 2010 UTC (14 months, 2 weeks ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.61: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.61: +6 -4 lines
SVN rev 215879 on 2010-11-26 19:48:27Z by marius

MFC: r214608, r215297(partial), r215713

o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control
  support in mii(4):
  - Merge generic flow control advertisement (which can be enabled by
    passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from
    NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD,
    IFM_FLOW isn't implemented as a global option via the "don't care
    mask" but instead as a media specific option this. This has the
    following advantages:
    o allows flow control advertisement with autonegotiation to be
      turned on and off via ifconfig(8) with the default typically
      being off (though MIIF_FORCEPAUSE has been added causing flow
      control to be always advertised, allowing to easily MFC this
      changes for drivers that previously used home-grown support for
      flow control that behaved that way without breaking POLA)
    o allows to deal with PHY drivers where flow control advertisement
      with manual selection doesn't work or at least isn't implemented,
      like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4),
      by setting MIIF_NOMANPAUSE
    o the available combinations of media options are readily available
      from the `ifconfig -m` output
  - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE
    and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so
    these are understood by ifconfig(8).
o Make the master/slave support in mii(4) actually usable:
  - Change IFM_ETH_MASTER from being implemented as a global option via
    the "don't care mask" to a media specific one as it actually is only
    applicable to IFM_1000_T to date.
  - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to
    actually configure manually selected slave mode (like we also do in
    the PHY specific implementations).
  - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it
    is understood by ifconfig(8).
o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4),
  e1000phy(4) and ip1000phy(4) to use the generic flow control support
  instead of home-grown solutions via IFM_FLAGs. This includes changing
  these PHY drivers and smcphy(4) to no longer unconditionally advertise
  support for flow control but only if the selected media has IFM_FLOW
  set (or MIIF_FORCEPAUSE is set) and implemented for these media variants,
  i.e. typically only for copper.
o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and
  set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0
  and some IFM_FLAGn.
o Switch brgphy(4) to add at least the the supported copper media based on
  the contents of the BMSR via mii_phy_add_media() instead of hardcoding
  them. The latter approach seems to have developed historically, besides
  causing unnecessary code duplication it was also undesirable because
  brgphy_mii_phy_auto() already based the capability advertisement on the
  contents of the BMSR though.
o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not
  just BCM5701. Apparently this was a misinterpretation of a workaround
  in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and
  BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but
  this doesn't mean we can't set these as well on other PHYs for manual
  media selection.
o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so
  IFM_1000_T master mode support now is generally available with all PHY
  drivers.
o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's
  not applicable there.

Reviewed by:	yongari (plus additional testing)
Obtained from:	NetBSD (partially), OpenBSD (partially)

Unlike as in head, bge(4), bce(4), msk(4), nfe(4) and stge(4) are changed
to set MIIF_FORCEPAUSE in stable/7 so they continue to always advertise
support of flow control and brgphy(4), ciphy(4), e1000phy(4) as well as
ip1000phy(4) are changed to still also accept IFF_LINK0 in addition to
the master media option for setting master mode, both in order to not
violate POLA.

Revision 1.334: download - view: text, markup, annotated - select for diffs
Sun Nov 14 15:15:22 2010 UTC (14 months, 3 weeks ago) by marius
Branches: MAIN
Diff to: previous 1.333: preferred, colored
Changes since revision 1.333: +23 -5 lines
SVN rev 215302 on 2010-11-14 15:15:22Z by marius

Move the limiting of the PHY to 10/100 modes of operation due to limitations
of certain MAC models from brgphy(4) to bge(4) where it belongs. While at it,
update the list of models having that restriction to what OpenBSD uses, which
in turn seems to have obtained that information from the Linux tg3 driver.

Revision 1.333: download - view: text, markup, annotated - select for diffs
Sun Nov 14 13:26:10 2010 UTC (14 months, 3 weeks ago) by marius
Branches: MAIN
Diff to: previous 1.332: preferred, colored
Changes since revision 1.332: +6 -4 lines
SVN rev 215297 on 2010-11-14 13:26:10Z by marius

o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control
  support in mii(4):
  - Merge generic flow control advertisement (which can be enabled by
    passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from
    NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD,
    IFM_FLOW isn't implemented as a global option via the "don't care
    mask" but instead as a media specific option this. This has the
    following advantages:
    o allows flow control advertisement with autonegotiation to be
      turned on and off via ifconfig(8) with the default typically
      being off (though MIIF_FORCEPAUSE has been added causing flow
      control to be always advertised, allowing to easily MFC this
      changes for drivers that previously used home-grown support for
      flow control that behaved that way without breaking POLA)
    o allows to deal with PHY drivers where flow control advertisement
      with manual selection doesn't work or at least isn't implemented,
      like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4),
      by setting MIIF_NOMANPAUSE
    o the available combinations of media options are readily available
      from the `ifconfig -m` output
  - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE
    and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so
    these are understood by ifconfig(8).
o Make the master/slave support in mii(4) actually usable:
  - Change IFM_ETH_MASTER from being implemented as a global option via
    the "don't care mask" to a media specific one as it actually is only
    applicable to IFM_1000_T to date.
  - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to
    actually configure manually selected slave mode (like we also do in
    the PHY specific implementations).
  - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it
    is understood by ifconfig(8).
o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4),
  e1000phy(4) and ip1000phy(4) to use the generic flow control support
  instead of home-grown solutions via IFM_FLAGs. This includes changing
  these PHY drivers and smcphy(4) to no longer unconditionally advertise
  support for flow control but only if the selected media has IFM_FLOW
  set (or MIIF_FORCEPAUSE is set) and implemented for these media variants,
  i.e. typically only for copper.
o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and
  set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0
  and some IFM_FLAGn.
o Switch brgphy(4) to add at least the the supported copper media based on
  the contents of the BMSR via mii_phy_add_media() instead of hardcoding
  them. The latter approach seems to have developed historically, besides
  causing unnecessary code duplication it was also undesirable because
  brgphy_mii_phy_auto() already based the capability advertisement on the
  contents of the BMSR though.
o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not
  just BCM5701. Apparently this was a misinterpretation of a workaround
  in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and
  BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but
  this doesn't mean we can't set these as well on other PHYs for manual
  media selection.
o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so
  IFM_1000_T master mode support now is generally available with all PHY
  drivers.
o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's
  not applicable there.

Reviewed by:	yongari (plus additional testing)
Obtained from:	NetBSD (partially), OpenBSD (partially)
MFC after:	2 weeks

Revision 1.198.2.61: download - view: text, markup, annotated - select for diffs
Mon Nov 8 19:54:44 2010 UTC (15 months ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.60: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.60: +250 -67 lines
SVN rev 215000 on 2010-11-08 19:54:44Z by yongari

MFC r214428:
  Add initial BCM5718 family support. The BCM5718 family includes
  the dual port BCM5717 and BCM5718 devices which are intended for
  mainstream workstation and entry-level server designs and
  represents the twelfth generation of NetXtreme Ethernet controllers.
  This family is the successor to the BCM5714/BCM5715 family and
  supports IPv4/IPv6 checksum offloading, TSO, VLAN hardware tagging,
  jumbo frames, MSI/MSIX, IOV, RSS and TSS.

  This change set supports all hardware features except IOV and
  RSS/TSS. Unlike its predecessors, only extended RX buffer
  descriptors can be posted to the jumbo producer ring. Single RX
  buffer descriptors for jumbo frame are not supported. RSS requires
  a more substantial set of changes and will apply to a larger set
  of NetXtreme devices so RSS/TSS multi-queue support will be
  implemented in a future releases.

  Special thanks to Broadcom who kindly sent a sample board to me
  and to davidch who gave provided the initial support code.

  Submitted by:	davidch (initial version)
  HW donated by:	Broadcom

Revision 1.226.2.45: download - view: text, markup, annotated - select for diffs
Mon Nov 8 19:36:00 2010 UTC (15 months ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.44: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.44: +250 -67 lines
SVN rev 214997 on 2010-11-08 19:36:00Z by yongari

MFC r214428:
  Add initial BCM5718 family support. The BCM5718 family includes
  the dual port BCM5717 and BCM5718 devices which are intended for
  mainstream workstation and entry-level server designs and
  represents the twelfth generation of NetXtreme Ethernet controllers.
  This family is the successor to the BCM5714/BCM5715 family and
  supports IPv4/IPv6 checksum offloading, TSO, VLAN hardware tagging,
  jumbo frames, MSI/MSIX, IOV, RSS and TSS.

  This change set supports all hardware features except IOV and
  RSS/TSS. Unlike its predecessors, only extended RX buffer
  descriptors can be posted to the jumbo producer ring. Single RX
  buffer descriptors for jumbo frame are not supported. RSS requires
  a more substantial set of changes and will apply to a larger set
  of NetXtreme devices so RSS/TSS multi-queue support will be
  implemented in a future releases.

  Special thanks to Broadcom who kindly sent a sample board to me
  and to davidch who gave provided the initial support code.

  Submitted by:	davidch (initial version)
  HW donated by:	Broadcom

Revision 1.198.2.60: download - view: text, markup, annotated - select for diffs
Sun Nov 7 11:12:30 2010 UTC (15 months ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.59: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.59: +7 -11 lines
SVN rev 214910 on 2010-11-07 11:12:30Z by marius

MFC: r213893, r213908, r214566, r214605, r214846

Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 (MFC'ed to stable/8 in r214685) to
get rid of certain hacks. For the most part these were:
- Artificially limiting miibus_{read,write}reg methods to certain PHY
  addresses; we now let mii_attach() only probe the PHY at the desired
  address(es) instead.
- PHY drivers setting MIIF_* flags based on the NIC driver they hang
  off from, partly even based on grabbing and using the softc of the
  parent; we now pass these flags down from the NIC to the PHY drivers
  via mii_attach(). This got us rid of all such hacks except those of
  brgphy() in combination with bce(4) and bge(4), which is way beyond
  what can be expressed with simple flags.

While at it, I took the opportunity to change the NIC drivers to pass
up the error returned by mii_attach() (previously by mii_phy_probe())
and unify the error message used in this case where and as appropriate
as mii_attach() actually can fail for a number of reasons, not just
because of no PHY(s) being present at the expected address(es).

Reviewed by:	jhb, yongari

Revision 1.226.2.44: download - view: text, markup, annotated - select for diffs
Sun Nov 7 11:12:29 2010 UTC (15 months ago) by marius
Branches: RELENG_8
Diff to: previous 1.226.2.43: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.43: +7 -11 lines
SVN rev 214909 on 2010-11-07 11:12:29Z by marius

MFC: r213893, r213908, r214566, r214605, r214846

Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 (MFC'ed to stable/8 in r214684) to
get rid of certain hacks. For the most part these were:
- Artificially limiting miibus_{read,write}reg methods to certain PHY
  addresses; we now let mii_attach() only probe the PHY at the desired
  address(es) instead.
- PHY drivers setting MIIF_* flags based on the NIC driver they hang
  off from, partly even based on grabbing and using the softc of the
  parent; we now pass these flags down from the NIC to the PHY drivers
  via mii_attach(). This got us rid of all such hacks except those of
  brgphy() in combination with bce(4) and bge(4), which is way beyond
  what can be expressed with simple flags.

While at it, I took the opportunity to change the NIC drivers to pass
up the error returned by mii_attach() (previously by mii_phy_probe())
and unify the error message used in this case where and as appropriate
as mii_attach() actually can fail for a number of reasons, not just
because of no PHY(s) being present at the expected address(es).

Reviewed by:	jhb, yongari

Revision 1.198.2.59: download - view: text, markup, annotated - select for diffs
Wed Nov 3 00:13:22 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.58: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.58: +53 -2 lines
SVN rev 214715 on 2010-11-03 00:13:22Z by yongari

MFC r214087,214219,214251,214292:
r214087:
  Add workaround for BCM5906 controller silicon bug. If device
  receive two back-to-back send BDs with less than or equal to 8
  total bytes then the device may hang. The two back-to-back send
  BDs must be in the same frame for this failure to occur.
  Thanks to davidch for detailed errata information.

  Reviewed by:	davidch

r214219:
  Add workaround for BCM5906 A1 controller silicon bug. When
  auto-negotiation results in half-duplex operation, excess collision
  on the ethernet link may cause internal chip delays that may result
  in subsequent valid frames being dropped due to insufficient
  receive buffer resources. The workaround is to choose de-pipeline
  method as a flow control decision for SDI. De-pipeline method
  allows only 1 data in TxMbuf at a time such that a request to RDMA
  from SDI is made only when TxMbuf is empty. Thanks for david for
  providing detailed errata information.

r214251:
  Apply the same workaround for SDI flow control used on BCM5906 A1
  to BCM6906 A0/A2. This should fix a long standing BCM5906 A2 lockup
  issues. Data sheet explicitly mentions BCM5906 A0, A1 and A2 use
  de-pipelined mode on these revisions.
  Special thanks to Buganini who tried all combinations of
  experimental patches for more than 10 days.

  Tested by:	Buganini <buganini <> gmail dot com >

r214292:
  Use bge_chipid to compare controller ids. r214251 incorrectly used
  bge_chiprev.

  Reported by:	Buganini <buganini <> gmail dot com >

Revision 1.226.2.43: download - view: text, markup, annotated - select for diffs
Wed Nov 3 00:03:26 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.42: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.42: +51 -0 lines
SVN rev 214714 on 2010-11-03 00:03:26Z by yongari

MFC r214087,214219,214251,214292:
r214087:
  Add workaround for BCM5906 controller silicon bug. If device
  receive two back-to-back send BDs with less than or equal to 8
  total bytes then the device may hang. The two back-to-back send
  BDs must be in the same frame for this failure to occur.
  Thanks to davidch for detailed errata information.

  Reviewed by:	davidch

r214219:
  Add workaround for BCM5906 A1 controller silicon bug. When
  auto-negotiation results in half-duplex operation, excess collision
  on the ethernet link may cause internal chip delays that may result
  in subsequent valid frames being dropped due to insufficient
  receive buffer resources. The workaround is to choose de-pipeline
  method as a flow control decision for SDI. De-pipeline method
  allows only 1 data in TxMbuf at a time such that a request to RDMA
  from SDI is made only when TxMbuf is empty. Thanks for david for
  providing detailed errata information.

r214251:
  Apply the same workaround for SDI flow control used on BCM5906 A1
  to BCM6906 A0/A2. This should fix a long standing BCM5906 A2 lockup
  issues. Data sheet explicitly mentions BCM5906 A0, A1 and A2 use
  de-pipelined mode on these revisions.
  Special thanks to Buganini who tried all combinations of
  experimental patches for more than 10 days.

  Tested by:	Buganini <buganini <> gmail dot com >

r214292:
  Use bge_chipid to compare controller ids. r214251 incorrectly used
  bge_chiprev.

  Reported by:	Buganini <buganini <> gmail dot com >

Revision 1.198.2.58: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:56:35 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.57: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.57: +38 -7 lines
SVN rev 214713 on 2010-11-02 23:56:35Z by yongari

MFC r213747,213808,214216:
r213747:
  Protect bge(4) from accessing invalid NIC internal memory regions
  on BCM5906.

  Tested by:	Buganini < buganini <> gmail dot com >

r213808:
  Add more checks for resolved link speed in bge_miibus_statchg().
  Link UP state could be reported first before actual completion of
  auto-negotiation. This change makes bge(4) reprogram BGE_MAC_MODE,
  BGE_TX_MODE and BGE_RX_MODE register only after controller got a
  valid link.

r214216:
  Enable TX MAC state machine lockup fix for both BCM5755 or higher
  and BCM5906. Publicly available data sheet just says it may happen
  due to corrupted TxMbuf.

Revision 1.226.2.42: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:54:59 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.41: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.41: +38 -7 lines
SVN rev 214712 on 2010-11-02 23:54:59Z by yongari

MFC r213747,213808,214216:
r213747:
  Protect bge(4) from accessing invalid NIC internal memory regions
  on BCM5906.

  Tested by:	Buganini < buganini <> gmail dot com >

r213808:
  Add more checks for resolved link speed in bge_miibus_statchg().
  Link UP state could be reported first before actual completion of
  auto-negotiation. This change makes bge(4) reprogram BGE_MAC_MODE,
  BGE_TX_MODE and BGE_RX_MODE register only after controller got a
  valid link.

r214216:
  Enable TX MAC state machine lockup fix for both BCM5755 or higher
  and BCM5906. Publicly available data sheet just says it may happen
  due to corrupted TxMbuf.

Revision 1.198.2.57: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:49:48 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.56: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.56: +25 -19 lines
SVN rev 214711 on 2010-11-02 23:49:48Z by yongari

MFC r213522,213587,213711:
r213522:
  Fix a long standing bug which regarded some revisions of controller
  as 5788. This caused BGE_MISC_LOCAL_CTL register is used to
  generate link state change interrupt for non-5788 controllers. The
  interrupt handler may or may not detect link state attention as
  status block wouldn't be updated when an interrupt was generated
  with BGE_MISC_LOCAL_CTL register. All controllers except 5700 and
  5788 should use host coalescing mode register to trigger an
  interrupt.

r213587:
  Do not blindly UP the interface when interface's MTU is changed. If
  driver is not running there is no need to up the interface. While
  I'm here hold driver lock before modifying MTU as it is referenced
  in RX handler.

r213711:
  The IFF_DRV_RUNNING flag is set at the end of bge_init_locked. But
  before setting the flag, interrupt was already enabled such that
  interrupt handler could be run before setting IFF_DRV_RUNNING flag.
  This can lose initial link state change interrupt which in turn
  make bge(4) think that it still does not have valid link. Fix this
  race by protecting the taskqueue with a driver lock.
  While I'm here move reenabling interrupt code after handling of link
  state chage.

  Reviewed by:	davidch

Revision 1.226.2.41: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:48:08 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.40: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.40: +25 -19 lines
SVN rev 214710 on 2010-11-02 23:48:08Z by yongari

MFC r213522,213587,213711:
r213522:
  Fix a long standing bug which regarded some revisions of controller
  as 5788. This caused BGE_MISC_LOCAL_CTL register is used to
  generate link state change interrupt for non-5788 controllers. The
  interrupt handler may or may not detect link state attention as
  status block wouldn't be updated when an interrupt was generated
  with BGE_MISC_LOCAL_CTL register. All controllers except 5700 and
  5788 should use host coalescing mode register to trigger an
  interrupt.

r213587:
  Do not blindly UP the interface when interface's MTU is changed. If
  driver is not running there is no need to up the interface. While
  I'm here hold driver lock before modifying MTU as it is referenced
  in RX handler.

r213711:
  The IFF_DRV_RUNNING flag is set at the end of bge_init_locked. But
  before setting the flag, interrupt was already enabled such that
  interrupt handler could be run before setting IFF_DRV_RUNNING flag.
  This can lose initial link state change interrupt which in turn
  make bge(4) think that it still does not have valid link. Fix this
  race by protecting the taskqueue with a driver lock.
  While I'm here move reenabling interrupt code after handling of link
  state chage.

  Reviewed by:	davidch

Revision 1.198.2.56: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:43:27 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.55: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.55: +104 -38 lines
SVN rev 214707 on 2010-11-02 23:43:27Z by yongari

MFC r213495,213742:
r213495:
  Add more comments to rings supported by the controller. Different
  versions of controller support different number of ring control
  blocks such that adjust code a bit to access known number of
  send/receive ring control blocks. Previously bge(4) blindly
  accessed 16 send/receive RCBs. Also move initializing standard
  receive producer ring producer index, jumbo receive producer ring
  producer index and mini receive producer ring producer index to
  the end of each receive producer ring initialization.

  Do not assume mini receive producer ring is available only when
  controller has jumbo frame capability, instead explicitly check
  ASIC version BCM5700 to disable mini receive producer ring.

  Additionally always enable send ring 0 regardless of controller
  versions. Previously bge(4) didn't enable send ring 0 if controller
  is BGE_IS_5705_PLUS. Becase bge(4) need 1 send ring to send frames
  at least, I have no idea how it would have worked so far.

  Submitted by:	davidch

r213742:
  Fix a regression introduced in r213495. r213495 disabled mini
  receive producer ring only for BCM5700. It was believed that
  BCM5700 with external SSRAM is the only controller that supports
  mini ring but it seems all BCM570[0-4] requires to disable mini
  receive producer ring. Otherwise, it caused unexpected RX DMA
  error or watchdog timeouts.

  Reported by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
  Tested by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>

Revision 1.226.2.40: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:41:43 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.39: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.39: +104 -38 lines
SVN rev 214706 on 2010-11-02 23:41:43Z by yongari

MFC r213495,213742:
r213495:
  Add more comments to rings supported by the controller. Different
  versions of controller support different number of ring control
  blocks such that adjust code a bit to access known number of
  send/receive ring control blocks. Previously bge(4) blindly
  accessed 16 send/receive RCBs. Also move initializing standard
  receive producer ring producer index, jumbo receive producer ring
  producer index and mini receive producer ring producer index to
  the end of each receive producer ring initialization.

  Do not assume mini receive producer ring is available only when
  controller has jumbo frame capability, instead explicitly check
  ASIC version BCM5700 to disable mini receive producer ring.

  Additionally always enable send ring 0 regardless of controller
  versions. Previously bge(4) didn't enable send ring 0 if controller
  is BGE_IS_5705_PLUS. Becase bge(4) need 1 send ring to send frames
  at least, I have no idea how it would have worked so far.

  Submitted by:	davidch

r213742:
  Fix a regression introduced in r213495. r213495 disabled mini
  receive producer ring only for BCM5700. It was believed that
  BCM5700 with external SSRAM is the only controller that supports
  mini ring but it seems all BCM570[0-4] requires to disable mini
  receive producer ring. Otherwise, it caused unexpected RX DMA
  error or watchdog timeouts.

  Reported by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
  Tested by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>

Revision 1.198.2.55: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:36:54 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.54: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.54: +65 -44 lines
SVN rev 214705 on 2010-11-02 23:36:54Z by yongari

MFC r213485,213710,213812:
r213485:
  Overhaul MII register access routine and remove unnecessary
  BGE_MI_MODE register accesses. Previously bge(4) used to read
  BGE_MI_MODE register to detect whether it needs to disable
  autopolling feature or not. Because we don't touch autopolling in
  other part of driver there is no reason to read BGE_MI_MODE
  register given that we know default value in advance. In order to
  achieve the goal, check whether the controller has CPMU(Central
  Power Mangement Unit) capability. If controller has CPMU feature,
  use 500KHz MII management interface(mdio/mdc) frequency regardless
  core clock frequency. Otherwise use default MII clock. While I'm
  here, add CPMU register definition.

  In bge_miibus_readreg(), rearrange code a bit and remove goto
  statement. In bge_miibus_writereg(), make sure to restore
  autopolling even if MII write failed. The delay time inserted after
  accessing BGE_MI_MODE register increased from 40us to 80us.

  The default PHY address is now stored in softc. All PHYs supported
  by bge(4) currently uses PHY address 1 but it will be changed when
  we add newer controllers. This change will make it easier to change
  default PHY address depending on PHY models.

  Submitted by:	davidch

r213710:
  Remove one last reference of BGE_MI_MODE register for auto polling.
  Previously bge(4) always enabled auto polling for non-BGE_FLAG_TBI
  controllers. With this change, auto polling is not used anymore so
  polling through mii(4) was introduced.

  Reviewed by:	davidch

r213812:
  Fix a regression introduced in r213710. r213710 removed the use of
  auto polling such that it made all controllers obtain link status
  information from the state of the LNKRDY input signal. Broadcom
  recommends disabling auto polling such that driver should rely on
  PHY interrupts for link status change indications. Unfortunately it
  seems some controllers(BCM5703, BCM5704 and BCM5705) have PHY
  related issues so Linux took other approach to workaround it.
  bge(4) didn't follow that and it used to enable auto polling to
  workaround it. Restore this old behavior for BCM5700 family
  controllers and BCM5705 to use auto polling. For BCM5700 and
  BCM5701, it seems it does not need to enable auto polling but I
  restored it for safety.
  Special thanks to marius who tried lots of patches with patience.

  Reported by:	marius
  Tested by:	marius

Revision 1.226.2.39: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:35:08 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.38: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.38: +65 -44 lines
SVN rev 214704 on 2010-11-02 23:35:08Z by yongari

MFC r213485,213710,213812:
r213485:
  Overhaul MII register access routine and remove unnecessary
  BGE_MI_MODE register accesses. Previously bge(4) used to read
  BGE_MI_MODE register to detect whether it needs to disable
  autopolling feature or not. Because we don't touch autopolling in
  other part of driver there is no reason to read BGE_MI_MODE
  register given that we know default value in advance. In order to
  achieve the goal, check whether the controller has CPMU(Central
  Power Mangement Unit) capability. If controller has CPMU feature,
  use 500KHz MII management interface(mdio/mdc) frequency regardless
  core clock frequency. Otherwise use default MII clock. While I'm
  here, add CPMU register definition.

  In bge_miibus_readreg(), rearrange code a bit and remove goto
  statement. In bge_miibus_writereg(), make sure to restore
  autopolling even if MII write failed. The delay time inserted after
  accessing BGE_MI_MODE register increased from 40us to 80us.

  The default PHY address is now stored in softc. All PHYs supported
  by bge(4) currently uses PHY address 1 but it will be changed when
  we add newer controllers. This change will make it easier to change
  default PHY address depending on PHY models.

  Submitted by:	davidch

r213710:
  Remove one last reference of BGE_MI_MODE register for auto polling.
  Previously bge(4) always enabled auto polling for non-BGE_FLAG_TBI
  controllers. With this change, auto polling is not used anymore so
  polling through mii(4) was introduced.

  Reviewed by:	davidch

r213812:
  Fix a regression introduced in r213710. r213710 removed the use of
  auto polling such that it made all controllers obtain link status
  information from the state of the LNKRDY input signal. Broadcom
  recommends disabling auto polling such that driver should rely on
  PHY interrupts for link status change indications. Unfortunately it
  seems some controllers(BCM5703, BCM5704 and BCM5705) have PHY
  related issues so Linux took other approach to workaround it.
  bge(4) didn't follow that and it used to enable auto polling to
  workaround it. Restore this old behavior for BCM5700 family
  controllers and BCM5705 to use auto polling. For BCM5700 and
  BCM5701, it seems it does not need to enable auto polling but I
  restored it for safety.
  Special thanks to marius who tried lots of patches with patience.

  Reported by:	marius
  Tested by:	marius

Revision 1.198.2.54: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:26:07 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.53: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.53: +29 -14 lines
SVN rev 214703 on 2010-11-02 23:26:07Z by yongari

MFC r213411,213464-213465,213468:
r213411:
  Enable fix for read DMA FIFO overruns on controllers that have this
  fix. Note, we still need workaround for controllers that lacks this
  fix and it needs more work in RX BD updating.

  Submitted by:	davidch

r213464:
  Separate common flags into controller specific and PHY related
  flags. There should be no functional changes. This change will make
  it easy to add more quirk/flags in future.

  Reviewed by:	davidch

r213465:
  Rearrange code a bit to correctly set PHY flags. This change make
  it easy to add more newer ASICs.

  Obtained from:	OpenBSD

r213468:
  Fix bge(4) build breakage when BGE_REGISTER_DEBUG is defined.

Revision 1.226.2.38: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:23:48 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.37: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.37: +29 -14 lines
SVN rev 214702 on 2010-11-02 23:23:48Z by yongari

MFC r213411,213464-213465,213468:
r213411:
  Enable fix for read DMA FIFO overruns on controllers that have this
  fix. Note, we still need workaround for controllers that lacks this
  fix and it needs more work in RX BD updating.

  Submitted by:	davidch

r213464:
  Separate common flags into controller specific and PHY related
  flags. There should be no functional changes. This change will make
  it easy to add more quirk/flags in future.

  Reviewed by:	davidch

r213465:
  Rearrange code a bit to correctly set PHY flags. This change make
  it easy to add more newer ASICs.

  Obtained from:	OpenBSD

r213468:
  Fix bge(4) build breakage when BGE_REGISTER_DEBUG is defined.

Revision 1.198.2.53: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:07:38 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.52: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.52: +14 -6 lines
SVN rev 214701 on 2010-11-02 23:07:38Z by yongari

MFC r213316,213333-213334:
r213316:
  Fix IFCAP_TXCSUM/IFCAP_RXCSUM handling. Previously bge(4) used
  IFCAP_HWCSUM to know which capability should be changed such that
  disabling RX checksun offloading resulted in disabling TX checksum
  offloading.

r213333:
  Allow write DMA to request larger DMA burst size to get better
  performance on BCM5785.

  Obtained from:	OpenBSD

r213334:
  Remove extra semicolon.

Revision 1.226.2.37: download - view: text, markup, annotated - select for diffs
Tue Nov 2 23:04:23 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.36: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.36: +14 -6 lines
SVN rev 214700 on 2010-11-02 23:04:23Z by yongari

MFC r213316,213333-213334:
r213316:
  Fix IFCAP_TXCSUM/IFCAP_RXCSUM handling. Previously bge(4) used
  IFCAP_HWCSUM to know which capability should be changed such that
  disabling RX checksun offloading resulted in disabling TX checksum
  offloading.

r213333:
  Allow write DMA to request larger DMA burst size to get better
  performance on BCM5785.

  Obtained from:	OpenBSD

r213334:
  Remove extra semicolon.

Revision 1.198.2.52: download - view: text, markup, annotated - select for diffs
Tue Nov 2 22:59:45 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.51: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.51: +251 -18 lines
SVN rev 214699 on 2010-11-02 22:59:45Z by yongari

MFC r213283,213410:
r213283:
  Implement hardware MAC statistics for BCM5705 or newer Broadcom
  controllers. bge(4) exported MAC statistics on controllers that
  maintain the statistics in the NIC's internal memory. Newer
  controllers require register access to fetch these values. These
  counters provide useful information to diagnose driver issues.

r213410:
  Consistently use ifHCOutOctets/ifHCInOctets instead of Octets as
  these names are used in data sheet. Also use UnicastPkts,
  MulticastPkts and BroadcastPkts instead of UcastPkts, McastPkts
  and BcastPkts to clarify its meaning.

  Suggested by:	bde

Revision 1.226.2.36: download - view: text, markup, annotated - select for diffs
Tue Nov 2 22:57:20 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.35: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.35: +251 -18 lines
SVN rev 214698 on 2010-11-02 22:57:20Z by yongari

MFC r213283,213410:
r213283:
  Implement hardware MAC statistics for BCM5705 or newer Broadcom
  controllers. bge(4) exported MAC statistics on controllers that
  maintain the statistics in the NIC's internal memory. Newer
  controllers require register access to fetch these values. These
  counters provide useful information to diagnose driver issues.

r213410:
  Consistently use ifHCOutOctets/ifHCInOctets instead of Octets as
  these names are used in data sheet. Also use UnicastPkts,
  MulticastPkts and BroadcastPkts instead of UcastPkts, McastPkts
  and BcastPkts to clarify its meaning.

  Suggested by:	bde

Revision 1.198.2.51: download - view: text, markup, annotated - select for diffs
Tue Nov 2 22:48:52 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.50: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.50: +26 -8 lines
SVN rev 214696 on 2010-11-02 22:48:52Z by yongari

MFC r213081,213225,213280:
r213081:
  Always show asic/chip revision in device attach phase. There are
  too many bge(4) controllers there and model name does not
  necessarily match asic/chip revision. Relying on VPD string made
  it hard to identify exact asic/chip revision so the first step to
  debug bge(4) was getting exact asic/chip information with verbose
  boot which may not be available on production server.

r213255:
  Set the number of RX frames to receive after RX MBUF low watermark
  has reached. This reduced number of dropped frames when
  flow-control is enabled. Previously it dropped incoming frames once
  RX MBUF low watermark has reached. The value used in MAC RX MBUF
  low watermark is greater than or equal to 4 so receiving two more
  RX frames should not be a problem.

  Obtained from:	OpenBSD

r213280:
  After r207391, brgphy(4) passes resolved flow-control settings to
  parent driver. Use that information to configure flow-control.
  One drawback is there is no way to disable flow-control as we still
  don't have proper way to not advertise RX/TX pause capability to
  link partner. But I don't think it would cause severe problems and
  users can selectively disable flow-control in switch port.

Revision 1.226.2.35: download - view: text, markup, annotated - select for diffs
Tue Nov 2 22:44:51 2010 UTC (15 months, 1 week ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.34: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.34: +26 -8 lines
SVN rev 214694 on 2010-11-02 22:44:51Z by yongari

MFC r213081,213225,213280:
r213081:
  Always show asic/chip revision in device attach phase. There are
  too many bge(4) controllers there and model name does not
  necessarily match asic/chip revision. Relying on VPD string made
  it hard to identify exact asic/chip revision so the first step to
  debug bge(4) was getting exact asic/chip information with verbose
  boot which may not be available on production server.

r213255:
  Set the number of RX frames to receive after RX MBUF low watermark
  has reached. This reduced number of dropped frames when
  flow-control is enabled. Previously it dropped incoming frames once
  RX MBUF low watermark has reached. The value used in MAC RX MBUF
  low watermark is greater than or equal to 4 so receiving two more
  RX frames should not be a problem.

  Obtained from:	OpenBSD

r213280:
  After r207391, brgphy(4) passes resolved flow-control settings to
  parent driver. Use that information to configure flow-control.
  One drawback is there is no way to disable flow-control as we still
  don't have proper way to not advertise RX/TX pause capability to
  link partner. But I don't think it would cause severe problems and
  users can selectively disable flow-control in switch port.

Revision 1.332: download - view: text, markup, annotated - select for diffs
Wed Oct 27 17:20:19 2010 UTC (15 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.331: preferred, colored
Changes since revision 1.331: +250 -67 lines
SVN rev 214428 on 2010-10-27 17:20:19Z by yongari

Add initial BCM5718 family support. The BCM5718 family includes
the dual port BCM5717 and BCM5718 devices which are intended for
mainstream workstation and entry-level server designs and
represents the twelfth generation of NetXtreme Ethernet controllers.
This family is the successor to the BCM5714/BCM5715 family and
supports IPv4/IPv6 checksum offloading, TSO, VLAN hardware tagging,
jumbo frames, MSI/MSIX, IOV, RSS and TSS.

This change set supports all hardware features except IOV and
RSS/TSS. Unlike its predecessors, only extended RX buffer
descriptors can be posted to the jumbo producer ring. Single RX
buffer descriptors for jumbo frame are not supported. RSS requires
a more substantial set of changes and will apply to a larger set
of NetXtreme devices so RSS/TSS multi-queue support will be
implemented in a future releases.

Special thanks to Broadcom who kindly sent a sample board to me
and to davidch who gave provided the initial support code.

Submitted by:	davidch (initial version)
HW donated by:	Broadcom

Revision 1.198.2.50: download - view: text, markup, annotated - select for diffs
Sun Oct 24 21:17:23 2010 UTC (15 months, 2 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.49: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.49: +2 -0 lines
SVN rev 214296 on 2010-10-24 21:17:23Z by yongari

MFC r213844:
  Make sure to not use stale ip/tcp header pointers. The ip/tcp
  header parser uses m_pullup(9) to get access to mbuf chain.
  m_pullup(9) can allocate new mbuf chain and free old one if the
  space left in the mbuf chain is not enough to hold requested
  contiguous bytes. Previously drivers can use stale ip/tcp header
  pointer if m_pullup(9) returned new mbuf chain.

  Reported by:	Andrew Boyer (aboyer <> averesystems dot com)

Revision 1.226.2.34: download - view: text, markup, annotated - select for diffs
Sun Oct 24 21:14:01 2010 UTC (15 months, 2 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.33: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.33: +2 -0 lines
SVN rev 214295 on 2010-10-24 21:14:01Z by yongari

MFC r213844:
  Make sure to not use stale ip/tcp header pointers. The ip/tcp
  header parser uses m_pullup(9) to get access to mbuf chain.
  m_pullup(9) can allocate new mbuf chain and free old one if the
  space left in the mbuf chain is not enough to hold requested
  contiguous bytes. Previously drivers can use stale ip/tcp header
  pointer if m_pullup(9) returned new mbuf chain.

  Reported by:	Andrew Boyer (aboyer <> averesystems dot com)

Revision 1.331: download - view: text, markup, annotated - select for diffs
Sun Oct 24 20:54:46 2010 UTC (15 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.330: preferred, colored
Changes since revision 1.330: +3 -3 lines
SVN rev 214292 on 2010-10-24 20:54:46Z by yongari

Use bge_chipid to compare controller ids. r214251 incorrectly used
bge_chiprev.

Reported by:	Buganini <buganini <> gmail dot com >

Revision 1.330: download - view: text, markup, annotated - select for diffs
Sat Oct 23 21:25:50 2010 UTC (15 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.329: preferred, colored
Changes since revision 1.329: +8 -5 lines
SVN rev 214251 on 2010-10-23 21:25:50Z by yongari

Apply the same workaround for SDI flow control used on BCM5906 A1
to BCM6906 A0/A2. This should fix a long standing BCM5906 A2 lockup
issues. Data sheet explicitly mentions BCM5906 A0, A1 and A2 use
de-pipelined mode on these revisions.
Special thanks to Buganini who tried all combinations of
experimental patches for more than 10 days.

Tested by:	Buganini <buganini <> gmail dot com >

Revision 1.329: download - view: text, markup, annotated - select for diffs
Fri Oct 22 19:30:56 2010 UTC (15 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.328: preferred, colored
Changes since revision 1.328: +5 -0 lines
SVN rev 214219 on 2010-10-22 19:30:56Z by yongari

Add workaround for BCM5906 A1 controller silicon bug. When
auto-negotiation results in half-duplex operation, excess collision
on the ethernet link may cause internal chip delays that may result
in subsequent valid frames being dropped due to insufficient
receive buffer resources. The workaround is to choose de-pipeline
method as a flow control decision for SDI. De-pipeline method
allows only 1 data in TxMbuf at a time such that a request to RDMA
from SDI is made only when TxMbuf is empty. Thanks for david for
providing detailed errata information.

Revision 1.328: download - view: text, markup, annotated - select for diffs
Fri Oct 22 18:31:44 2010 UTC (15 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.327: preferred, colored
Changes since revision 1.327: +6 -1 lines
SVN rev 214216 on 2010-10-22 18:31:44Z by yongari

Enable TX MAC state machine lockup fix for both BCM5755 or higher
and BCM5906. Publicly available data sheet just says it may happen
due to corrupted TxMbuf.

Revision 1.327: download - view: text, markup, annotated - select for diffs
Tue Oct 19 23:04:23 2010 UTC (15 months, 3 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.326: preferred, colored
Changes since revision 1.326: +43 -0 lines
SVN rev 214087 on 2010-10-19 23:04:23Z by yongari

Add workaround for BCM5906 controller silicon bug. If device
receive two back-to-back send BDs with less than or equal to 8
total bytes then the device may hang. The two back-to-back send
BDs must be in the same frame for this failure to occur.
Thanks to davidch for detailed errata information.

Reviewed by:	davidch

Revision 1.326: download - view: text, markup, annotated - select for diffs
Fri Oct 15 14:52:11 2010 UTC (15 months, 3 weeks ago) by marius
Branches: MAIN
Diff to: previous 1.325: preferred, colored
Changes since revision 1.325: +7 -11 lines
SVN rev 213893 on 2010-10-15 14:52:11Z by marius

Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 to get rid of certain hacks. For
the most part these were:
- Artificially limiting miibus_{read,write}reg methods to certain PHY
  addresses; we now let mii_attach() only probe the PHY at the desired
  address(es) instead.
- PHY drivers setting MIIF_* flags based on the NIC driver they hang
  off from, partly even based on grabbing and using the softc of the
  parent; we now pass these flags down from the NIC to the PHY drivers
  via mii_attach(). This got us rid of all such hacks except those of
  brgphy() in combination with bce(4) and bge(4), which is way beyond
  what can be expressed with simple flags.

While at it, I took the opportunity to change the NIC drivers to pass
up the error returned by mii_attach() (previously by mii_phy_probe())
and unify the error message used in this case where and as appropriate
as mii_attach() actually can fail for a number of reasons, not just
because of no PHY(s) being present at the expected address(es).

Reviewed by:	jhb, yongari

Revision 1.325: download - view: text, markup, annotated - select for diffs
Thu Oct 14 18:31:40 2010 UTC (15 months, 3 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.324: preferred, colored
Changes since revision 1.324: +2 -0 lines
SVN rev 213844 on 2010-10-14 18:31:40Z by yongari

Make sure to not use stale ip/tcp header pointers. The ip/tcp
header parser uses m_pullup(9) to get access to mbuf chain.
m_pullup(9) can allocate new mbuf chain and free old one if the
space left in the mbuf chain is not enough to hold requested
contiguous bytes. Previously drivers can use stale ip/tcp header
pointer if m_pullup(9) returned new mbuf chain.

Reported by:	Andrew Boyer (aboyer <> averesystems dot com)
MFC after:	10 days

Revision 1.324: download - view: text, markup, annotated - select for diffs
Wed Oct 13 22:29:48 2010 UTC (15 months, 4 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.323: preferred, colored
Changes since revision 1.323: +7 -0 lines
SVN rev 213812 on 2010-10-13 22:29:48Z by yongari

Fix a regression introduced in r213710. r213710 removed the use of
auto polling such that it made all controllers obtain link status
information from the state of the LNKRDY input signal. Broadcom
recommends disabling auto polling such that driver should rely on
PHY interrupts for link status change indications. Unfortunately it
seems some controllers(BCM5703, BCM5704 and BCM5705) have PHY
related issues so Linux took other approach to workaround it.
bge(4) didn't follow that and it used to enable auto polling to
workaround it. Restore this old behavior for BCM5700 family
controllers and BCM5705 to use auto polling. For BCM5700 and
BCM5701, it seems it does not need to enable auto polling but I
restored it for safety.
Special thanks to marius who tried lots of patches with patience.

Reported by:	marius
Tested by:	marius

Revision 1.323: download - view: text, markup, annotated - select for diffs
Wed Oct 13 21:53:37 2010 UTC (15 months, 4 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.322: preferred, colored
Changes since revision 1.322: +24 -6 lines
SVN rev 213808 on 2010-10-13 21:53:37Z by yongari

Add more checks for resolved link speed in bge_miibus_statchg().
Link UP state could be reported first before actual completion of
auto-negotiation. This change makes bge(4) reprogram BGE_MAC_MODE,
BGE_TX_MODE and BGE_RX_MODE register only after controller got a
valid link.

Revision 1.322: download - view: text, markup, annotated - select for diffs
Tue Oct 12 19:31:25 2010 UTC (15 months, 4 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.321: preferred, colored
Changes since revision 1.321: +8 -0 lines
SVN rev 213747 on 2010-10-12 19:31:25Z by yongari

Protect bge(4) from accessing invalid NIC internal memory regions
on BCM5906.

Tested by:	Buganini < buganini <> gmail dot com >

Revision 1.321: download - view: text, markup, annotated - select for diffs
Tue Oct 12 19:22:03 2010 UTC (15 months, 4 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.320: preferred, colored
Changes since revision 1.320: +1 -1 lines
SVN rev 213742 on 2010-10-12 19:22:03Z by yongari

Fix a regression introduced in r213495. r213495 disabled mini
receive producer ring only for BCM5700. It was believed that
BCM5700 with external SSRAM is the only controller that supports
mini ring but it seems all BCM570[0-4] requires to disable mini
receive producer ring. Otherwise, it caused unexpected RX DMA
error or watchdog timeouts.

Reported by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
Tested by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>

Revision 1.320: download - view: text, markup, annotated - select for diffs
Mon Oct 11 23:07:12 2010 UTC (16 months ago) by yongari
Branches: MAIN
Diff to: previous 1.319: preferred, colored
Changes since revision 1.319: +13 -9 lines
SVN rev 213711 on 2010-10-11 23:07:12Z by yongari

The IFF_DRV_RUNNING flag is set at the end of bge_init_locked. But
before setting the flag, interrupt was already enabled such that
interrupt handler could be run before setting IFF_DRV_RUNNING flag.
This can lose initial link state change interrupt which in turn
make bge(4) think that it still does not have valid link. Fix this
race by protecting the taskqueue with a driver lock.
While I'm here move reenabling interrupt code after handling of link
state chage.

Reviewed by:	davidch

Revision 1.319: download - view: text, markup, annotated - select for diffs
Mon Oct 11 22:56:23 2010 UTC (16 months ago) by yongari
Branches: MAIN
Diff to: previous 1.318: preferred, colored
Changes since revision 1.318: +15 -5 lines
SVN rev 213710 on 2010-10-11 22:56:23Z by yongari

Remove one last reference of BGE_MI_MODE register for auto polling.
Previously bge(4) always enabled auto polling for non-BGE_FLAG_TBI
controllers. With this change, auto polling is not used anymore so
polling through mii(4) was introduced.

Reviewed by:	davidch

Revision 1.198.2.49: download - view: text, markup, annotated - select for diffs
Fri Oct 8 18:51:28 2010 UTC (16 months ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.48: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.48: +5 -6 lines
SVN rev 213596 on 2010-10-08 18:51:28Z by yongari

MFC r212069,212071:
r212069:
  bge_txeof() already checks whether it has to free transmitted mbufs
  or not by comparing reported TX consumer index with saved index. So
  remove unnecessary check done after freeing transmitted mbufs.
  While I'm here nuke unnecessary variable initializations.

r212071:
  Remove unnecessary atomic operation in bge_poll. bge(4) always
  holds a driver lock in the function entry and
  memory synchronization is handled by bus_dmamap_sync(9).

Revision 1.226.2.33: download - view: text, markup, annotated - select for diffs
Fri Oct 8 18:49:59 2010 UTC (16 months ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.32: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.32: +5 -6 lines
SVN rev 213595 on 2010-10-08 18:49:59Z by yongari

MFC r212069,212071:
r212069:
  bge_txeof() already checks whether it has to free transmitted mbufs
  or not by comparing reported TX consumer index with saved index. So
  remove unnecessary check done after freeing transmitted mbufs.
  While I'm here nuke unnecessary variable initializations.

r212071:
  Remove unnecessary atomic operation in bge_poll. bge(4) always
  holds a driver lock in the function entry and
  memory synchronization is handled by bus_dmamap_sync(9).

Revision 1.198.2.48: download - view: text, markup, annotated - select for diffs
Fri Oct 8 18:46:02 2010 UTC (16 months ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.47: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.47: +154 -238 lines
SVN rev 213594 on 2010-10-08 18:46:02Z by yongari

MFC r212061,212065,212302:
r212061:
  Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA
  tag. All controllers that are not BCM5755 or higher have 4GB
  boundary DMA bug. Previously bge(4) used 32bit DMA address to
  workaround the bug(r199670). However this caused the use of bounce
  buffers such that it resulted in poor performance for systems which
  have more than 4GB memory. Because bus_dma(9) honors boundary
  restriction requirement of DMA tag for dynamic buffers, having a
  separate TX/RX mbuf DMA tag will greatly reduce the possibility of
  using bounce buffers. For DMA buffers allocated with
  bus_dmamem_alloc(9), now bge(4) explicitly checks whether the
  requested memory region crossed the boundary or not.
  With this change, only the DMA buffer that crossed the boundary
  will use 32bit DMA address. Other DMA buffers are not affected as
  separate DMA tag is created for each DMA buffer.
  Even if 32bit DMA address space is used for a buffer, the chance to
  use bounce buffer is still very low as the size of buffer is small.
  This change should eliminate most usage of bounce buffers on
  systems that have more than 4GB memory.

  More correct fix would be teaching bus_dma(9) to honor boundary
  restriction for buffers created with bus_dmamem_alloc(9) but it
  seems that is not easy.

  While I'm here cleanup bge_dma_map_addr() and remove unnecessary
  member variables in bge_dmamap_arg structure.

  Tested by:	marcel

r212065:
  Handle PAE case correctly. You cannot effectively specify a 4GB
  boundary in PAE case so use a 2GB boundary for PAE as suggested by
  jhb.

  Pointed out by:	jhb
  Reviewed by:	jhb

r212302:
  Make sure to create DMA'able memory for statistics block. This was
  missed in r212061 and it caused crashes for 570x controllers as
  controller DMAed statistics to physical address 0.

  Reported by:	kan

Revision 1.226.2.32: download - view: text, markup, annotated - select for diffs
Fri Oct 8 18:43:06 2010 UTC (16 months ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.31: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.31: +154 -238 lines
SVN rev 213593 on 2010-10-08 18:43:06Z by yongari

MFC r212061,212065,212302:
r212061:
  Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA
  tag. All controllers that are not BCM5755 or higher have 4GB
  boundary DMA bug. Previously bge(4) used 32bit DMA address to
  workaround the bug(r199670). However this caused the use of bounce
  buffers such that it resulted in poor performance for systems which
  have more than 4GB memory. Because bus_dma(9) honors boundary
  restriction requirement of DMA tag for dynamic buffers, having a
  separate TX/RX mbuf DMA tag will greatly reduce the possibility of
  using bounce buffers. For DMA buffers allocated with
  bus_dmamem_alloc(9), now bge(4) explicitly checks whether the
  requested memory region crossed the boundary or not.
  With this change, only the DMA buffer that crossed the boundary
  will use 32bit DMA address. Other DMA buffers are not affected as
  separate DMA tag is created for each DMA buffer.
  Even if 32bit DMA address space is used for a buffer, the chance to
  use bounce buffer is still very low as the size of buffer is small.
  This change should eliminate most usage of bounce buffers on
  systems that have more than 4GB memory.

  More correct fix would be teaching bus_dma(9) to honor boundary
  restriction for buffers created with bus_dmamem_alloc(9) but it
  seems that is not easy.

  While I'm here cleanup bge_dma_map_addr() and remove unnecessary
  member variables in bge_dmamap_arg structure.

  Tested by:	marcel

r212065:
  Handle PAE case correctly. You cannot effectively specify a 4GB
  boundary in PAE case so use a 2GB boundary for PAE as suggested by
  jhb.

  Pointed out by:	jhb
  Reviewed by:	jhb

r212302:
  Make sure to create DMA'able memory for statistics block. This was
  missed in r212061 and it caused crashes for 570x controllers as
  controller DMAed statistics to physical address 0.

  Reported by:	kan

Revision 1.318: download - view: text, markup, annotated - select for diffs
Fri Oct 8 17:58:07 2010 UTC (16 months ago) by yongari
Branches: MAIN
Diff to: previous 1.317: preferred, colored
Changes since revision 1.317: +6 -2 lines
SVN rev 213587 on 2010-10-08 17:58:07Z by yongari

Do not blindly UP the interface when interface's MTU is changed. If
driver is not running there is no need to up the interface. While
I'm here hold driver lock before modifying MTU as it is referenced
in RX handler.

Revision 1.317: download - view: text, markup, annotated - select for diffs
Thu Oct 7 17:14:50 2010 UTC (16 months ago) by yongari
Branches: MAIN
Diff to: previous 1.316: preferred, colored
Changes since revision 1.316: +6 -8 lines
SVN rev 213522 on 2010-10-07 17:14:50Z by yongari

Fix a long standing bug which regarded some revisions of controller
as 5788. This caused BGE_MISC_LOCAL_CTL register is used to
generate link state change interrupt for non-5788 controllers. The
interrupt handler may or may not detect link state attention as
status block wouldn't be updated when an interrupt was generated
with BGE_MISC_LOCAL_CTL register. All controllers except 5700 and
5788 should use host coalescing mode register to trigger an
interrupt.

Revision 1.316: download - view: text, markup, annotated - select for diffs
Wed Oct 6 21:23:57 2010 UTC (16 months ago) by yongari
Branches: MAIN
Diff to: previous 1.315: preferred, colored
Changes since revision 1.315: +104 -38 lines
SVN rev 213495 on 2010-10-06 21:23:57Z by yongari

Add more comments to rings supported by the controller. Different
versions of controller support different number of ring control
blocks such that adjust code a bit to access known number of
send/receive ring control blocks. Previously bge(4) blindly
accessed 16 send/receive RCBs. Also move initializing standard
receive producer ring producer index, jumbo receive producer ring
producer index and mini receive producer ring producer index to
the end of each receive producer ring initialization.

Do not assume mini receive producer ring is available only when
controller has jumbo frame capability, instead explicitly check
ASIC version BCM5700 to disable mini receive producer ring.

Additionally always enable send ring 0 regardless of controller
versions. Previously bge(4) didn't enable send ring 0 if controller
is BGE_IS_5705_PLUS. Becase bge(4) need 1 send ring to send frames
at least, I have no idea how it would have worked so far.

Submitted by:	davidch

Revision 1.315: download - view: text, markup, annotated - select for diffs
Wed Oct 6 17:35:27 2010 UTC (16 months ago) by yongari
Branches: MAIN
Diff to: previous 1.314: preferred, colored
Changes since revision 1.314: +43 -39 lines
SVN rev 213485 on 2010-10-06 17:35:27Z by yongari

Overhaul MII register access routine and remove unnecessary
BGE_MI_MODE register accesses. Previously bge(4) used to read
BGE_MI_MODE register to detect whether it needs to disable
autopolling feature or not. Because we don't touch autopolling in
other part of driver there is no reason to read BGE_MI_MODE
register given that we know default value in advance. In order to
achieve the goal, check whether the controller has CPMU(Central
Power Mangement Unit) capability. If controller has CPMU feature,
use 500KHz MII management interface(mdio/mdc) frequency regardless
core clock frequency. Otherwise use default MII clock. While I'm
here, add CPMU register definition.

In bge_miibus_readreg(), rearrange code a bit and remove goto
statement. In bge_miibus_writereg(), make sure to restore
autopolling even if MII write failed. The delay time inserted after
accessing BGE_MI_MODE register increased from 40us to 80us.

The default PHY address is now stored in softc. All PHYs supported
by bge(4) currently uses PHY address 1 but it will be changed when
we add newer controllers. This change will make it easier to change
default PHY address depending on PHY models.

Submitted by:	davidch

Revision 1.314: download - view: text, markup, annotated - select for diffs
Wed Oct 6 01:23:40 2010 UTC (16 months ago) by yongari
Branches: MAIN
Diff to: previous 1.313: preferred, colored
Changes since revision 1.313: +1 -1 lines
SVN rev 213468 on 2010-10-06 01:23:40Z by yongari

Fix bge(4) build breakage when BGE_REGISTER_DEBUG is defined.

Revision 1.313: download - view: text, markup, annotated - select for diffs
Tue Oct 5 23:24:58 2010 UTC (16 months ago) by yongari
Branches: MAIN
Diff to: previous 1.312: preferred, colored
Changes since revision 1.312: +7 -5 lines
SVN rev 213465 on 2010-10-05 23:24:58Z by yongari

Rearrange code a bit to correctly set PHY flags. This change make
it easy to add more newer ASICs.

Obtained from:	OpenBSD

Revision 1.312: download - view: text, markup, annotated - select for diffs
Tue Oct 5 23:03:48 2010 UTC (16 months ago) by yongari
Branches: MAIN
Diff to: previous 1.311: preferred, colored
Changes since revision 1.311: +11 -11 lines
SVN rev 213464 on 2010-10-05 23:03:48Z by yongari

Separate common flags into controller specific and PHY related
flags. There should be no functional changes. This change will make
it easy to add more quirk/flags in future.

Reviewed by:	davidch

Revision 1.311: download - view: text, markup, annotated - select for diffs
Mon Oct 4 18:09:01 2010 UTC (16 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.310: preferred, colored
Changes since revision 1.310: +13 -0 lines
SVN rev 213411 on 2010-10-04 18:09:01Z by yongari

Enable fix for read DMA FIFO overruns on controllers that have this
fix. Note, we still need workaround for controllers that lacks this
fix and it needs more work in RX BD updating.

Submitted by:	davidch

Revision 1.310: download - view: text, markup, annotated - select for diffs
Mon Oct 4 18:01:23 2010 UTC (16 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.309: preferred, colored
Changes since revision 1.309: +9 -9 lines
SVN rev 213410 on 2010-10-04 18:01:23Z by yongari

Consistently use ifHCOutOctets/ifHCInOctets instead of Octets as
these names are used in data sheet. Also use UnicastPkts,
MulticastPkts and BroadcastPkts instead of UcastPkts, McastPkts
and BcastPkts to clarify its meaning.

Suggested by:	bde

Revision 1.309: download - view: text, markup, annotated - select for diffs
Fri Oct 1 17:51:55 2010 UTC (16 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.308: preferred, colored
Changes since revision 1.308: +2 -2 lines
SVN rev 213334 on 2010-10-01 17:51:55Z by yongari

Remove extra semicolon.

Revision 1.308: download - view: text, markup, annotated - select for diffs
Fri Oct 1 17:46:15 2010 UTC (16 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.307: preferred, colored
Changes since revision 1.307: +4 -0 lines
SVN rev 213333 on 2010-10-01 17:46:15Z by yongari

Allow write DMA to request larger DMA burst size to get better
performance on BCM5785.

Obtained from:	OpenBSD

Revision 1.307: download - view: text, markup, annotated - select for diffs
Thu Sep 30 22:34:15 2010 UTC (16 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.306: preferred, colored
Changes since revision 1.306: +8 -4 lines
SVN rev 213316 on 2010-09-30 22:34:15Z by yongari

Fix IFCAP_TXCSUM/IFCAP_RXCSUM handling. Previously bge(4) used
IFCAP_HWCSUM to know which capability should be changed such that
disabling RX checksun offloading resulted in disabling TX checksum
offloading.

Revision 1.306: download - view: text, markup, annotated - select for diffs
Wed Sep 29 21:56:31 2010 UTC (16 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.305: preferred, colored
Changes since revision 1.305: +247 -14 lines
SVN rev 213283 on 2010-09-29 21:56:31Z by yongari

Implement hardware MAC statistics for BCM5705 or newer Broadcom
controllers. bge(4) exported MAC statistics on controllers that
maintain the statistics in the NIC's internal memory. Newer
controllers require register access to fetch these values. These
counters provide useful information to diagnose driver issues.

Revision 1.305: download - view: text, markup, annotated - select for diffs
Wed Sep 29 21:19:25 2010 UTC (16 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.304: preferred, colored
Changes since revision 1.304: +13 -2 lines
SVN rev 213280 on 2010-09-29 21:19:25Z by yongari

After r207391, brgphy(4) passes resolved flow-control settings to
parent driver. Use that information to configure flow-control.
One drawback is there is no way to disable flow-control as we still
don't have proper way to not advertise RX/TX pause capability to
link partner. But I don't think it would cause severe problems and
users can selectively disable flow-control in switch port.

Revision 1.304: download - view: text, markup, annotated - select for diffs
Wed Sep 29 00:00:45 2010 UTC (16 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.303: preferred, colored
Changes since revision 1.303: +8 -0 lines
SVN rev 213255 on 2010-09-29 00:00:45Z by yongari

Set the number of RX frames to receive after RX MBUF low watermark
has reached. This reduced number of dropped frames when
flow-control is enabled. Previously it dropped incoming frames once
RX MBUF low watermark has reached. The value used in MAC RX MBUF
low watermark is greater than or equal to 4 so receiving two more
RX frames should not be a problem.

Obtained from:	OpenBSD

Revision 1.198.2.47: download - view: text, markup, annotated - select for diffs
Mon Sep 27 17:12:54 2010 UTC (16 months, 2 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.46: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.46: +4 -2 lines
SVN rev 213209 on 2010-09-27 17:12:54Z by yongari

MFC r212755:
  Fix incorrect RX BD producer updates. The producer index was
  already updated after allocating mbuf so driver had to use the last
  index instead of using next producer index. This should fix driver
  hang which may happen under high network load.

  Reported by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
  Tested by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>

Revision 1.226.2.31: download - view: text, markup, annotated - select for diffs
Mon Sep 27 17:10:22 2010 UTC (16 months, 2 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.30: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.30: +4 -2 lines
SVN rev 213208 on 2010-09-27 17:10:22Z by yongari

MFC r212755:
  Fix incorrect RX BD producer updates. The producer index was
  already updated after allocating mbuf so driver had to use the last
  index instead of using next producer index. This should fix driver
  hang which may happen under high network load.

  Reported by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
  Tested by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>

Revision 1.198.2.46: download - view: text, markup, annotated - select for diffs
Fri Sep 24 18:01:43 2010 UTC (16 months, 2 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.45: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.45: +41 -7 lines
SVN rev 213110 on 2010-09-24 18:01:43Z by yongari

MFC r211596:
  It seems all Broadcom controllers have a bug that can generate UDP
  datagrams with checksum value 0 when TX UDP checksum offloading is
  enabled.  Generating UDP checksum value 0 is RFC 768 violation.
  Even though the probability of generating such UDP datagrams is
  low, I don't want to see FreeBSD boxes to inject such datagrams
  into network so disable UDP checksum offloading by default.  Users
  still override this behavior by setting a sysctl variable or loader
  tunable, dev.bge.%d.forced_udpcsum.

  I have no idea why this issue was not reported so far given that
  bge(4) is one of the most commonly used controller on high-end
  server class systems. Thanks to andre@ who passed the PR to me.

  PR:	kern/104826

Revision 1.226.2.30: download - view: text, markup, annotated - select for diffs
Fri Sep 24 17:59:58 2010 UTC (16 months, 2 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.29: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.29: +41 -7 lines
SVN rev 213109 on 2010-09-24 17:59:58Z by yongari

MFC r211596:
  It seems all Broadcom controllers have a bug that can generate UDP
  datagrams with checksum value 0 when TX UDP checksum offloading is
  enabled.  Generating UDP checksum value 0 is RFC 768 violation.
  Even though the probability of generating such UDP datagrams is
  low, I don't want to see FreeBSD boxes to inject such datagrams
  into network so disable UDP checksum offloading by default.  Users
  still override this behavior by setting a sysctl variable or loader
  tunable, dev.bge.%d.forced_udpcsum.

  I have no idea why this issue was not reported so far given that
  bge(4) is one of the most commonly used controller on high-end
  server class systems. Thanks to andre@ who passed the PR to me.

  PR:	kern/104826

Revision 1.198.2.45: download - view: text, markup, annotated - select for diffs
Fri Sep 24 17:56:12 2010 UTC (16 months, 2 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.44: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.44: +6 -3 lines
SVN rev 213108 on 2010-09-24 17:56:12Z by yongari

MFC r211594:
  Load tunable from loader.conf(5) instead of device.hints(5).

Revision 1.226.2.29: download - view: text, markup, annotated - select for diffs
Fri Sep 24 17:53:32 2010 UTC (16 months, 2 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.28: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.28: +6 -3 lines
SVN rev 213107 on 2010-09-24 17:53:32Z by yongari

MFC r211594:
  Load tunable from loader.conf(5) instead of device.hints(5).

Revision 1.303: download - view: text, markup, annotated - select for diffs
Thu Sep 23 18:55:54 2010 UTC (16 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.302: preferred, colored
Changes since revision 1.302: +5 -6 lines
SVN rev 213081 on 2010-09-23 18:55:54Z by yongari

Always show asic/chip revision in device attach phase. There are
too many bge(4) controllers there and model name does not
necessarily match asic/chip revision. Relying on VPD string made
it hard to identify exact asic/chip revision so the first step to
debug bge(4) was getting exact asic/chip information with verbose
boot which may not be available on production server.

Revision 1.302: download - view: text, markup, annotated - select for diffs
Thu Sep 16 17:32:37 2010 UTC (16 months, 3 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.301: preferred, colored
Changes since revision 1.301: +4 -2 lines
SVN rev 212755 on 2010-09-16 17:32:37Z by yongari

Fix incorrect RX BD producer updates. The producer index was
already updated after allocating mbuf so driver had to use the last
index instead of using next producer index. This should fix driver
hang which may happen under high network load.

Reported by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
Tested by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
MFC after:	10 days

Revision 1.301: download - view: text, markup, annotated - select for diffs
Tue Sep 7 18:29:29 2010 UTC (17 months ago) by yongari
Branches: MAIN
Diff to: previous 1.300: preferred, colored
Changes since revision 1.300: +9 -0 lines
SVN rev 212302 on 2010-09-07 18:29:29Z by yongari

Make sure to create DMA'able memory for statistics block. This was
missed in r212061 and it caused crashes for 570x controllers as
controller DMAed statistics to physical address 0.

Reported by:	kan

Revision 1.300: download - view: text, markup, annotated - select for diffs
Tue Aug 31 20:56:18 2010 UTC (17 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.299: preferred, colored
Changes since revision 1.299: +2 -2 lines
SVN rev 212071 on 2010-08-31 20:56:18Z by yongari

Remove unnecessary atomic operation in bge_poll. bge(4) always
holds a driver lock in the function entry and
memory synchronization is handled by bus_dmamap_sync(9).

Revision 1.299: download - view: text, markup, annotated - select for diffs
Tue Aug 31 19:59:18 2010 UTC (17 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.298: preferred, colored
Changes since revision 1.298: +3 -4 lines
SVN rev 212069 on 2010-08-31 19:59:18Z by yongari

bge_txeof() already checks whether it has to free transmitted mbufs
or not by comparing reported TX consumer index with saved index. So
remove unnecessary check done after freeing transmitted mbufs.
While I'm here nuke unnecessary variable initializations.

Revision 1.298: download - view: text, markup, annotated - select for diffs
Tue Aug 31 18:48:09 2010 UTC (17 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.297: preferred, colored
Changes since revision 1.297: +1 -1 lines
SVN rev 212065 on 2010-08-31 18:48:09Z by yongari

Handle PAE case correctly. You cannot effectively specify a 4GB
boundary in PAE case so use a 2GB boundary for PAE as suggested by
jhb.

Pointed out by:	jhb
Reviewed by:	jhb

Revision 1.297: download - view: text, markup, annotated - select for diffs
Tue Aug 31 17:33:48 2010 UTC (17 months, 1 week ago) by yongari
Branches: MAIN
Diff to: previous 1.296: preferred, colored
Changes since revision 1.296: +145 -238 lines
SVN rev 212061 on 2010-08-31 17:33:48Z by yongari

Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA
tag. All controllers that are not BCM5755 or higher have 4GB
boundary DMA bug. Previously bge(4) used 32bit DMA address to
workaround the bug(r199670). However this caused the use of bounce
buffers such that it resulted in poor performance for systems which
have more than 4GB memory. Because bus_dma(9) honors boundary
restriction requirement of DMA tag for dynamic buffers, having a
separate TX/RX mbuf DMA tag will greatly reduce the possibility of
using bounce buffers. For DMA buffers allocated with
bus_dmamem_alloc(9), now bge(4) explicitly checks whether the
requested memory region crossed the boundary or not.
With this change, only the DMA buffer that crossed the boundary
will use 32bit DMA address. Other DMA buffers are not affected as
separate DMA tag is created for each DMA buffer.
Even if 32bit DMA address space is used for a buffer, the chance to
use bounce buffer is still very low as the size of buffer is small.
This change should eliminate most usage of bounce buffers on
systems that have more than 4GB memory.

More correct fix would be teaching bus_dma(9) to honor boundary
restriction for buffers created with bus_dmamem_alloc(9) but it
seems that is not easy.

While I'm here cleanup bge_dma_map_addr() and remove unnecessary
member variables in bge_dmamap_arg structure.

Tested by:	marcel

Revision 1.296: download - view: text, markup, annotated - select for diffs
Sun Aug 22 01:39:09 2010 UTC (17 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.295: preferred, colored
Changes since revision 1.295: +41 -7 lines
SVN rev 211596 on 2010-08-22 01:39:09Z by yongari

It seems all Broadcom controllers have a bug that can generate UDP
datagrams with checksum value 0 when TX UDP checksum offloading is
enabled.  Generating UDP checksum value 0 is RFC 768 violation.
Even though the probability of generating such UDP datagrams is
low, I don't want to see FreeBSD boxes to inject such datagrams
into network so disable UDP checksum offloading by default.  Users
still override this behavior by setting a sysctl variable or loader
tunable, dev.bge.%d.forced_udpcsum.

I have no idea why this issue was not reported so far given that
bge(4) is one of the most commonly used controller on high-end
server class systems. Thanks to andre@ who passed the PR to me.

PR:	kern/104826

Revision 1.295: download - view: text, markup, annotated - select for diffs
Sat Aug 21 23:13:16 2010 UTC (17 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.294: preferred, colored
Changes since revision 1.294: +6 -3 lines
SVN rev 211594 on 2010-08-21 23:13:16Z by yongari

Load tunable from loader.conf(5) instead of device.hints(5).

Revision 1.198.2.44: download - view: text, markup, annotated - select for diffs
Sun Aug 15 23:07:06 2010 UTC (17 months, 3 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.43: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.43: +2 -28 lines
SVN rev 211376 on 2010-08-15 23:07:06Z by yongari

MFC r205651:
  Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim
  read request size.

Revision 1.226.2.28: download - view: text, markup, annotated - select for diffs
Sun Aug 15 23:02:41 2010 UTC (17 months, 3 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.27: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.27: +2 -28 lines
SVN rev 211375 on 2010-08-15 23:02:41Z by yongari

MFC r205651:
  Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim
  read request size.

Revision 1.198.2.43: download - view: text, markup, annotated - select for diffs
Sun Aug 15 22:59:35 2010 UTC (17 months, 3 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.42: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.42: +4 -7 lines
SVN rev 211374 on 2010-08-15 22:59:35Z by yongari

MFC r210083,210152:
r210083:
  Remove enabling Data FIFO protection with indirect memory access.
  r165114 added that code and that change ignored the same logic
  committed in r135772. In addition, data FIFO protection should be
  selectively enabled instead of applying to all PCIe devices.
  While I'm here add BCM5785 to devices that do not require this
  fix.

r210152:
  Use Miscellaneous Configuration Register bit definition instead of
  magic number.

Revision 1.226.2.27: download - view: text, markup, annotated - select for diffs
Sun Aug 15 22:57:50 2010 UTC (17 months, 3 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.26: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.26: +4 -7 lines
SVN rev 211373 on 2010-08-15 22:57:50Z by yongari

MFC r210083,210152:
r210083:
  Remove enabling Data FIFO protection with indirect memory access.
  r165114 added that code and that change ignored the same logic
  committed in r135772. In addition, data FIFO protection should be
  selectively enabled instead of applying to all PCIe devices.
  While I'm here add BCM5785 to devices that do not require this
  fix.

r210152:
  Use Miscellaneous Configuration Register bit definition instead of
  magic number.

Revision 1.198.2.42: download - view: text, markup, annotated - select for diffs
Sun Aug 15 22:53:46 2010 UTC (17 months, 3 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.41: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.41: +20 -22 lines
SVN rev 211372 on 2010-08-15 22:53:46Z by yongari

MFC r210011,210013-210015:
r210011:
  Make bge_stop_fw() static.
  While I'm here use ANSI function definitions.

r210013:
  style.

r210014:
  Fix error message for jumbo buffer allocation failure.

r210015:
  Prefer PCIR_BAR macro over BGE_PCI_BAR0.

Revision 1.226.2.26: download - view: text, markup, annotated - select for diffs
Sun Aug 15 22:51:52 2010 UTC (17 months, 3 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.25: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.25: +20 -22 lines
SVN rev 211371 on 2010-08-15 22:51:52Z by yongari

MFC r210011,210013-210015:
r210011:
  Make bge_stop_fw() static.
  While I'm here use ANSI function definitions.

r210013:
  style.

r210014:
  Fix error message for jumbo buffer allocation failure.

r210015:
  Prefer PCIR_BAR macro over BGE_PCI_BAR0.

Revision 1.198.2.41: download - view: text, markup, annotated - select for diffs
Sun Aug 15 22:45:40 2010 UTC (17 months, 3 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.40: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.40: +8 -4 lines
SVN rev 211370 on 2010-08-15 22:45:40Z by yongari

MFC r209741:
  Zero entire status block and add missing bus_dmamap_sync(9).

Revision 1.226.2.25: download - view: text, markup, annotated - select for diffs
Sun Aug 15 22:44:28 2010 UTC (17 months, 3 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.24: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.24: +8 -4 lines
SVN rev 211369 on 2010-08-15 22:44:28Z by yongari

MFC r209741:
  Zero entire status block and add missing bus_dmamap_sync(9).

Revision 1.198.2.40: download - view: text, markup, annotated - select for diffs
Sun Aug 15 22:42:15 2010 UTC (17 months, 3 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.39: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.39: +5 -1 lines
SVN rev 211368 on 2010-08-15 22:42:15Z by yongari

MFC r209714:
  It seems read DMA mode register requires both IPv4 TSO and IPv6 TSO
  configuration to get IPv4 TSO work on BCM57780. While I'm here
  apply the same fix to BCM5785 which shares similar hardware feature
  of BCM57780. This change makes TSO work on BCM57780.

  Tested by:	Tong Liu <nemoliu <> gmail dot com>

Revision 1.226.2.24: download - view: text, markup, annotated - select for diffs
Sun Aug 15 22:40:47 2010 UTC (17 months, 3 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.23: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.23: +5 -1 lines
SVN rev 211367 on 2010-08-15 22:40:47Z by yongari

MFC r209714:
  It seems read DMA mode register requires both IPv4 TSO and IPv6 TSO
  configuration to get IPv4 TSO work on BCM57780. While I'm here
  apply the same fix to BCM5785 which shares similar hardware feature
  of BCM57780. This change makes TSO work on BCM57780.

  Tested by:	Tong Liu <nemoliu <> gmail dot com>

Revision 1.294: download - view: text, markup, annotated - select for diffs
Thu Jul 15 23:34:58 2010 UTC (18 months, 3 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.293: preferred, colored
Changes since revision 1.293: +1 -1 lines
SVN rev 210152 on 2010-07-15 23:34:58Z by yongari

Use Miscellaneous Configuration Register bit definition instead of
magic number.

Revision 1.293: download - view: text, markup, annotated - select for diffs
Wed Jul 14 21:47:49 2010 UTC (18 months, 4 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.292: preferred, colored
Changes since revision 1.292: +3 -6 lines
SVN rev 210083 on 2010-07-14 21:47:49Z by yongari

Remove enabling Data FIFO protection with indirect memory access.
r165114 added that code and that change ignored the same logic
committed in r135772. In addition, data FIFO protection should be
selectively enabled instead of applying to all PCIe devices.
While I'm here add BCM5785 to devices that do not require this
fix.

Revision 1.292: download - view: text, markup, annotated - select for diffs
Tue Jul 13 19:45:40 2010 UTC (18 months, 4 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.291: preferred, colored
Changes since revision 1.291: +2 -2 lines
SVN rev 210015 on 2010-07-13 19:45:40Z by yongari

Prefer PCIR_BAR macro over BGE_PCI_BAR0.

Revision 1.291: download - view: text, markup, annotated - select for diffs
Tue Jul 13 19:42:55 2010 UTC (18 months, 4 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.290: preferred, colored
Changes since revision 1.290: +1 -1 lines
SVN rev 210014 on 2010-07-13 19:42:55Z by yongari

Fix error message for jumbo buffer allocation failure.

Revision 1.290: download - view: text, markup, annotated - select for diffs
Tue Jul 13 19:39:51 2010 UTC (18 months, 4 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.289: preferred, colored
Changes since revision 1.289: +9 -7 lines
SVN rev 210013 on 2010-07-13 19:39:51Z by yongari

style.

Revision 1.289: download - view: text, markup, annotated - select for diffs
Tue Jul 13 19:33:46 2010 UTC (18 months, 4 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.288: preferred, colored
Changes since revision 1.288: +9 -13 lines
SVN rev 210011 on 2010-07-13 19:33:46Z by yongari

Make bge_stop_fw() static.
While I'm here use ANSI function definitions.

Revision 1.288: download - view: text, markup, annotated - select for diffs
Tue Jul 6 18:17:31 2010 UTC (19 months ago) by yongari
Branches: MAIN
Diff to: previous 1.287: preferred, colored
Changes since revision 1.287: +8 -4 lines
SVN rev 209741 on 2010-07-06 18:17:31Z by yongari

Zero entire status block and add missing bus_dmamap_sync(9).

Revision 1.287: download - view: text, markup, annotated - select for diffs
Tue Jul 6 02:07:59 2010 UTC (19 months ago) by yongari
Branches: MAIN
Diff to: previous 1.286: preferred, colored
Changes since revision 1.286: +5 -1 lines
SVN rev 209714 on 2010-07-06 02:07:59Z by yongari

It seems read DMA mode register requires both IPv4 TSO and IPv6 TSO
configuration to get IPv4 TSO work on BCM57780. While I'm here
apply the same fix to BCM5785 which shares similar hardware feature
of BCM57780. This change makes TSO work on BCM57780.

Tested by:	Tong Liu <nemoliu <> gmail dot com>

Revision 1.226.2.23.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 4 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.226.2.23: preferred, colored; next MAIN 1.226.2.24: preferred, colored
Changes since revision 1.226.2.23: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.198.2.39: download - view: text, markup, annotated - select for diffs
Thu Jun 10 18:04:25 2010 UTC (20 months ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.38: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.38: +49 -16 lines
SVN rev 208995 on 2010-06-10 18:04:25Z by yongari

MFC r208862:
  Fix a bug introduced in r199011. When bge(4) reuses loaded RX
  buffers it should also reinitialize RX descriptors otherwise some
  stale data could be passed to controller. This could end up with
  mbuf double free or unexpected NULL pointer dereference in upper
  stack. To fix the issue, save loaded buffer's length and
  reinitialize RX descriptors with the saved value whenever bge(4)
  reuses the loaded RX buffers.
  While I'm here, increase the number of RX buffers to 512 from 256.
  This simplifies RX buffer handling as well as giving more RX
  buffers. Controller supports just fixed number of RX buffers
  (i.e. 512) and bge(4) used to rely on hope that our CPU is fast
  enough to keep up with the controller. With this change, bge(4)
  will use 1MB for RX buffers but I don't think it would cause
  problems in these days.

  Reported by:	marcel
  Tested by:	marcel

Revision 1.226.2.23: download - view: text, markup, annotated - select for diffs
Thu Jun 10 17:53:35 2010 UTC (20 months ago) by yongari
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.226.2.22: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.22: +49 -16 lines
SVN rev 208993 on 2010-06-10 17:53:35Z by yongari

MFC r208862:
  Fix a bug introduced in r199011. When bge(4) reuses loaded RX
  buffers it should also reinitialize RX descriptors otherwise some
  stale data could be passed to controller. This could end up with
  mbuf double free or unexpected NULL pointer dereference in upper
  stack. To fix the issue, save loaded buffer's length and
  reinitialize RX descriptors with the saved value whenever bge(4)
  reuses the loaded RX buffers.
  While I'm here, increase the number of RX buffers to 512 from 256.
  This simplifies RX buffer handling as well as giving more RX
  buffers. Controller supports just fixed number of RX buffers
  (i.e. 512) and bge(4) used to rely on hope that our CPU is fast
  enough to keep up with the controller. With this change, bge(4)
  will use 1MB for RX buffers but I don't think it would cause
  problems in these days.

  Reported by:	marcel
  Tested by:	marcel
  Approved by:	re (bz)

Revision 1.286: download - view: text, markup, annotated - select for diffs
Sat Jun 5 23:29:24 2010 UTC (20 months ago) by yongari
Branches: MAIN
Diff to: previous 1.285: preferred, colored
Changes since revision 1.285: +49 -16 lines
SVN rev 208862 on 2010-06-05 23:29:24Z by yongari

Fix a bug introduced in r199011. When bge(4) reuses loaded RX
buffers it should also reinitialize RX descriptors otherwise some
stale data could be passed to controller. This could end up with
mbuf double free or unexpected NULL pointer dereference in upper
stack. To fix the issue, save loaded buffer's length and
reinitialize RX descriptors with the saved value whenever bge(4)
reuses the loaded RX buffers.
While I'm here, increase the number of RX buffers to 512 from 256.
This simplifies RX buffer handling as well as giving more RX
buffers. Controller supports just fixed number of RX buffers
(i.e. 512) and bge(4) used to rely on hope that our CPU is fast
enough to keep up with the controller. With this change, bge(4)
will use 1MB for RX buffers but I don't think it would cause
problems in these days.

Reported by:	marcel
Tested by:	marcel

Revision 1.226.2.22: download - view: text, markup, annotated - select for diffs
Mon May 10 18:46:37 2010 UTC (21 months ago) by marius
Branches: RELENG_8
Diff to: previous 1.226.2.21: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.21: +1 -1 lines
SVN rev 207861 on 2010-05-10 18:46:37Z by marius

MFC: r207242

For the on-board interfaces found in Fujitsu SPARC64 machines obtain the
MAC address via OFW as well.

Revision 1.198.2.38: download - view: text, markup, annotated - select for diffs
Mon May 10 18:46:37 2010 UTC (21 months ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.37: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.37: +1 -1 lines
SVN rev 207862 on 2010-05-10 18:46:37Z by marius

MFC: r207242

For the on-board interfaces found in Fujitsu SPARC64 machines obtain the
MAC address via OFW as well.

Revision 1.285: download - view: text, markup, annotated - select for diffs
Mon Apr 26 18:56:06 2010 UTC (21 months, 2 weeks ago) by marius
Branches: MAIN
Diff to: previous 1.284: preferred, colored
Changes since revision 1.284: +1 -1 lines
SVN rev 207242 on 2010-04-26 18:56:06Z by marius

For the on-board interfaces found in Fujitsu SPARC64 machines obtain the
MAC address via OFW as well.

Revision 1.284: download - view: text, markup, annotated - select for diffs
Thu Mar 25 17:17:35 2010 UTC (22 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.283: preferred, colored
Changes since revision 1.283: +2 -28 lines
SVN rev 205651 on 2010-03-25 17:17:35Z by yongari

Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim
read request size.

Revision 1.198.2.37: download - view: text, markup, annotated - select for diffs
Wed Mar 24 17:32:20 2010 UTC (22 months, 2 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.36: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.36: +41 -1 lines
SVN rev 205616 on 2010-03-24 17:32:20Z by yongari

MFC r204975,204978-204979,204981:
r204975:
  Enable hardware fixes for BCM5704 B0 as recommended by data sheet.
r204978:
  Set maximum read byte count to 2048 for PCI-X BCM5703/5704 devices.
  Also disable relaxed ordering as recommended by data sheet for
  PCI-X devices. For PCI-X BCM5704, set maximum outstanding split
  transactions to 0 as indicated by data sheet.
  For BCM5703 in PCI-X mode, DMA read watermark should be less than
  or equal to maximum read byte count configuration. Enforce this
  limitation in DMA read watermark configuration.
r204979:
  Fix typo in r204975.
r204981:
  Fix typo in r204978.

Revision 1.226.2.21: download - view: text, markup, annotated - select for diffs
Wed Mar 24 17:29:32 2010 UTC (22 months, 2 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.20: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.20: +41 -1 lines
SVN rev 205615 on 2010-03-24 17:29:32Z by yongari

MFC r204975,204978-204979,204981:
r204975:
  Enable hardware fixes for BCM5704 B0 as recommended by data sheet.
r204978:
  Set maximum read byte count to 2048 for PCI-X BCM5703/5704 devices.
  Also disable relaxed ordering as recommended by data sheet for
  PCI-X devices. For PCI-X BCM5704, set maximum outstanding split
  transactions to 0 as indicated by data sheet.
  For BCM5703 in PCI-X mode, DMA read watermark should be less than
  or equal to maximum read byte count configuration. Enforce this
  limitation in DMA read watermark configuration.
r204979:
  Fix typo in r204975.
r204981:
  Fix typo in r204978.

Revision 1.198.2.36: download - view: text, markup, annotated - select for diffs
Tue Mar 23 22:17:49 2010 UTC (22 months, 2 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.35: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.35: +3 -1 lines
SVN rev 205552 on 2010-03-23 22:17:49Z by yongari

MFC r204376:
  Disable TSO on BCM5755M controller until I understand better for
  the issue. I still have no idea why TSO does not work on this
  controller. davidch@ also confirmed there is no known TSO related
  issues for this controller.

Revision 1.226.2.20: download - view: text, markup, annotated - select for diffs
Tue Mar 23 22:16:12 2010 UTC (22 months, 2 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.19: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.19: +3 -1 lines
SVN rev 205549 on 2010-03-23 22:16:12Z by yongari

MFC r204376:
  Disable TSO on BCM5755M controller until I understand better for
  the issue. I still have no idea why TSO does not work on this
  controller. davidch@ also confirmed there is no known TSO related
  issues for this controller.

Revision 1.198.2.35: download - view: text, markup, annotated - select for diffs
Tue Mar 23 19:24:17 2010 UTC (22 months, 2 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.34: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.34: +15 -26 lines
SVN rev 205524 on 2010-03-23 19:24:17Z by yongari

MFC r204151,204223:
r204151:
  Add TSO support on VLAN. Controller requires VLAN hardware tagging
  to make TSO work on VLAN. So if VLAN hardware tagging is disabled
  explicitly clear TSO on VLAN. While I'm here remove duplicated
  VLAN_CAPABILITIES call.

r204223:
  Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
  not support TSO over VLAN if VLAN hardware tagging is disabled so
  there is no need to check VLAN here.
  While I'm here make sure to pullup IP/TCP headers in the first
  buffer.

Revision 1.226.2.19: download - view: text, markup, annotated - select for diffs
Tue Mar 23 19:16:35 2010 UTC (22 months, 2 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.18: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.18: +15 -26 lines
SVN rev 205523 on 2010-03-23 19:16:35Z by yongari

MFC r204151,204223:
r204151:
  Add TSO support on VLAN. Controller requires VLAN hardware tagging
  to make TSO work on VLAN. So if VLAN hardware tagging is disabled
  explicitly clear TSO on VLAN. While I'm here remove duplicated
  VLAN_CAPABILITIES call.

r204223:
  Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
  not support TSO over VLAN if VLAN hardware tagging is disabled so
  there is no need to check VLAN here.
  While I'm here make sure to pullup IP/TCP headers in the first
  buffer.

Revision 1.198.2.34: download - view: text, markup, annotated - select for diffs
Thu Mar 18 18:52:18 2010 UTC (22 months, 3 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.33: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.33: +9 -6 lines
SVN rev 205289 on 2010-03-18 18:52:18Z by yongari

MFC r203358,203716:

r203358:
  PCI express device status register has W1C feature. Writing 0 has
  no effect. Make sure to clear error bits by writing 1. [1]
  While I'm here use predefined value instead of hardcodig magic
  vlaue.

  Submitted by:	msaitoh at NetBSD [1]

r203716:
  Move device specific flag configuration to attach routine.
  The softc obtained in device probe wouldn't be the same one used in
  device attach. Drivers should not assume any values stored in softc
  structure in probe routine will be available for its attach routine.

Revision 1.226.2.18: download - view: text, markup, annotated - select for diffs
Thu Mar 18 18:50:20 2010 UTC (22 months, 3 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.17: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.17: +9 -6 lines
SVN rev 205288 on 2010-03-18 18:50:20Z by yongari

MFC r203358,203716:

r203358:
  PCI express device status register has W1C feature. Writing 0 has
  no effect. Make sure to clear error bits by writing 1. [1]
  While I'm here use predefined value instead of hardcodig magic
  vlaue.

  Submitted by:	msaitoh at NetBSD [1]

r203716:
  Move device specific flag configuration to attach routine.
  The softc obtained in device probe wouldn't be the same one used in
  device attach. Drivers should not assume any values stored in softc
  structure in probe routine will be available for its attach routine.

Revision 1.198.2.33: download - view: text, markup, annotated - select for diffs
Thu Mar 18 18:38:53 2010 UTC (22 months, 3 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.32: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.32: +2 -3 lines
SVN rev 205285 on 2010-03-18 18:38:53Z by yongari

MFC r202821-202822.

r202821:
  Fix a long standing ASF heartbeat sending bug. The initial
  implementation of heartbeat interval was 2 but there was typo which
  caused the heartbeat is sent approximately every 5 seconds. This
  caused unintended controller reset by firmware because firmware
  thought OS was crashed.

  Submitted by:	Floris Bos < info <> je-eigen-domein dot nl >
  Tested by:	Andrzej Tobola < ato <> iem dot pw dot edu dot pl >

r202822:
  Use new handshake command for BCM5750 or new controllers.

Revision 1.226.2.17: download - view: text, markup, annotated - select for diffs
Thu Mar 18 18:35:28 2010 UTC (22 months, 3 weeks ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.16: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.16: +2 -3 lines
SVN rev 205284 on 2010-03-18 18:35:28Z by yongari

MFC r202821-202822.

r202821:
  Fix a long standing ASF heartbeat sending bug. The initial
  implementation of heartbeat interval was 2 but there was typo which
  caused the heartbeat is sent approximately every 5 seconds. This
  caused unintended controller reset by firmware because firmware
  thought OS was crashed.

  Submitted by:	Floris Bos < info <> je-eigen-domein dot nl >
  Tested by:	Andrzej Tobola < ato <> iem dot pw dot edu dot pl >

r202822:
  Use new handshake command for BCM5750 or new controllers.

Revision 1.283: download - view: text, markup, annotated - select for diffs
Tue Mar 16 17:45:16 2010 UTC (22 months, 3 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.282: preferred, colored
Changes since revision 1.282: +16 -16 lines
SVN rev 205221 on 2010-03-16 17:45:16Z by yongari

Revert r205090.
It's hard to know when the mail box register write will get flushed to
the hardware and it may take longer.

Pointed out by:	scottl

Revision 1.282: download - view: text, markup, annotated - select for diffs
Fri Mar 12 18:18:04 2010 UTC (23 months ago) by yongari
Branches: MAIN
Diff to: previous 1.281: preferred, colored
Changes since revision 1.281: +16 -16 lines
SVN rev 205090 on 2010-03-12 18:18:04Z by yongari

Reorder interrupt handler a bit such that producer/consumer
index of status block is read first before acknowledging the
interrupts. Otherwise bge(4) may get stale status block as
acknowledging an interrupt may yield another status block update.

Reviewed by:	marius

Revision 1.281: download - view: text, markup, annotated - select for diffs
Wed Mar 10 21:37:19 2010 UTC (23 months ago) by yongari
Branches: MAIN
Diff to: previous 1.280: preferred, colored
Changes since revision 1.280: +1 -1 lines
SVN rev 204981 on 2010-03-10 21:37:19Z by yongari

Fix typo in r204978.

Pointed out by:	marius

Revision 1.280: download - view: text, markup, annotated - select for diffs
Wed Mar 10 20:55:55 2010 UTC (23 months ago) by yongari
Branches: MAIN
Diff to: previous 1.279: preferred, colored
Changes since revision 1.279: +1 -1 lines
SVN rev 204979 on 2010-03-10 20:55:55Z by yongari

Fix typo in r204975.

Pointed out by:	marius

Revision 1.279: download - view: text, markup, annotated - select for diffs
Wed Mar 10 20:54:08 2010 UTC (23 months ago) by yongari
Branches: MAIN
Diff to: previous 1.278: preferred, colored
Changes since revision 1.278: +29 -1 lines
SVN rev 204978 on 2010-03-10 20:54:08Z by yongari

Set maximum read byte count to 2048 for PCI-X BCM5703/5704 devices.
Also disable relaxed ordering as recommended by data sheet for
PCI-X devices. For PCI-X BCM5704, set maximum outstanding split
transactions to 0 as indicated by data sheet.
For BCM5703 in PCI-X mode, DMA read watermark should be less than
or equal to maximum read byte count configuration. Enforce this
limitation in DMA read watermark configuration.

Revision 1.278: download - view: text, markup, annotated - select for diffs
Wed Mar 10 20:22:57 2010 UTC (23 months ago) by yongari
Branches: MAIN
Diff to: previous 1.277: preferred, colored
Changes since revision 1.277: +12 -0 lines
SVN rev 204975 on 2010-03-10 20:22:57Z by yongari

Enable hardware fixes for BCM5704 B0 as recommended by data sheet.

Revision 1.277: download - view: text, markup, annotated - select for diffs
Fri Feb 26 22:29:42 2010 UTC (23 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.276: preferred, colored
Changes since revision 1.276: +3 -1 lines
SVN rev 204376 on 2010-02-26 22:29:42Z by yongari

Disable TSO on BCM5755M controller until I understand better for
the issue. I still have no idea why TSO does not work on this
controller. davidch@ also confirmed there is no known TSO related
issues for this controller.

Revision 1.276: download - view: text, markup, annotated - select for diffs
Mon Feb 22 21:03:15 2010 UTC (23 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.275: preferred, colored
Changes since revision 1.275: +5 -18 lines
SVN rev 204223 on 2010-02-22 21:03:15Z by yongari

Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
not support TSO over VLAN if VLAN hardware tagging is disabled so
there is no need to check VLAN here.
While I'm here make sure to pullup IP/TCP headers in the first
buffer.

Revision 1.275: download - view: text, markup, annotated - select for diffs
Sat Feb 20 23:21:06 2010 UTC (23 months, 2 weeks ago) by yongari
Branches: MAIN
Diff to: previous 1.274: preferred, colored
Changes since revision 1.274: +10 -8 lines
SVN rev 204151 on 2010-02-20 23:21:06Z by yongari

Add TSO support on VLAN. Controller requires VLAN hardware tagging
to make TSO work on VLAN. So if VLAN hardware tagging is disabled
explicitly clear TSO on VLAN. While I'm here remove duplicated
VLAN_CAPABILITIES call.

Revision 1.198.2.32.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (2 years ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.198.2.32: preferred, colored; next MAIN 1.198.2.33: preferred, colored
Changes since revision 1.198.2.32: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.274: download - view: text, markup, annotated - select for diffs
Tue Feb 9 19:12:06 2010 UTC (2 years ago) by yongari
Branches: MAIN
Diff to: previous 1.273: preferred, colored
Changes since revision 1.273: +4 -4 lines
SVN rev 203716 on 2010-02-09 19:12:06Z by yongari

Move device specific flag configuration to attach routine.
The softc obtained in device probe wouldn't be the same one used in
device attach. Drivers should not assume any values stored in softc
structure in probe routine will be available for its attach routine.

Revision 1.273: download - view: text, markup, annotated - select for diffs
Mon Feb 1 20:58:45 2010 UTC (2 years ago) by yongari
Branches: MAIN
Diff to: previous 1.272: preferred, colored
Changes since revision 1.272: +5 -2 lines
SVN rev 203358 on 2010-02-01 20:58:45Z by yongari

PCI express device status register has W1C feature. Writing 0 has
no effect. Make sure to clear error bits by writing 1. [1]
While I'm here use predefined value instead of hardcodig magic
vlaue.

Submitted by:	msaitoh at NetBSD [1]

Revision 1.226.2.16: download - view: text, markup, annotated - select for diffs
Sat Jan 23 01:25:09 2010 UTC (2 years ago) by delphij
Branches: RELENG_8
Diff to: previous 1.226.2.15: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.15: +3 -1 lines
SVN rev 202862 on 2010-01-23 01:25:09Z by delphij

MFC r202268:

 o Add PCI ID for BCM 5756.
 o Don't enable BGE_FLAG_BER_BUG on both 5722 and 5756, and based
   on their PCI IDs rather than their chip IDs.

Reported by:    several PC-BSD users via kmoore
Reviewed by:    yongari, imp, jhb, davidch
Sponsored by:   iXsystems, Inc.

Revision 1.198.2.32: download - view: text, markup, annotated - select for diffs
Sat Jan 23 01:20:59 2010 UTC (2 years ago) by delphij
Branches: RELENG_7
CVS tags: RELENG_7_3_BP
Branch point for: RELENG_7_3
Diff to: previous 1.198.2.31: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.31: +3 -1 lines
SVN rev 202861 on 2010-01-23 01:20:59Z by delphij

MFC r202268:

 o Add PCI ID for BCM 5756.
 o Don't enable BGE_FLAG_BER_BUG on both 5722 and 5756, and based
   on their PCI IDs rather than their chip IDs.

Reported by:    several PC-BSD users via kmoore
Reviewed by:    yongari, imp, jhb, davidch
Sponsored by:   iXsystems, Inc.

Revision 1.272: download - view: text, markup, annotated - select for diffs
Fri Jan 22 18:46:37 2010 UTC (2 years ago) by yongari
Branches: MAIN
Diff to: previous 1.271: preferred, colored
Changes since revision 1.271: +1 -2 lines
SVN rev 202822 on 2010-01-22 18:46:37Z by yongari

Use new handshake command for BCM5750 or new controllers.

Revision 1.271: download - view: text, markup, annotated - select for diffs
Fri Jan 22 18:35:50 2010 UTC (2 years ago) by yongari
Branches: MAIN
Diff to: previous 1.270: preferred, colored
Changes since revision 1.270: +1 -1 lines
SVN rev 202821 on 2010-01-22 18:35:50Z by yongari

Fix a long standing ASF heartbeat sending bug. The initial
implementation of heartbeat interval was 2 but there was typo which
caused the heartbeat is sent approximately every 5 seconds. This
caused unintended controller reset by firmware because firmware
thought OS was crashed.

Submitted by:	Floris Bos < info <> je-eigen-domein dot nl >
Tested by:	Andrzej Tobola < ato <> iem dot pw dot edu dot pl >

Revision 1.198.2.31: download - view: text, markup, annotated - select for diffs
Thu Jan 21 00:54:22 2010 UTC (2 years ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.30: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.30: +2 -5 lines
SVN rev 202731 on 2010-01-21 00:54:22Z by yongari

MFC r202406:
  Don't free mbuf chains when bge(4) fails to collapse the mbuf
  chains. This part of code is to enhance performance so failing the
  collapsing should not free TX frames. Otherwise bge(4) will
  unnecessarily drop frames which in turn can freeze the network
  connection.

  Reported by:	Igor Sysoev (is <> rambler-co dot ru)
  Tested by:	Igor Sysoev (is <> rambler-co dot ru)

Revision 1.226.2.15: download - view: text, markup, annotated - select for diffs
Thu Jan 21 00:53:00 2010 UTC (2 years ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.14: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.14: +2 -5 lines
SVN rev 202730 on 2010-01-21 00:53:00Z by yongari

MFC r202406:
  Don't free mbuf chains when bge(4) fails to collapse the mbuf
  chains. This part of code is to enhance performance so failing the
  collapsing should not free TX frames. Otherwise bge(4) will
  unnecessarily drop frames which in turn can freeze the network
  connection.

  Reported by:	Igor Sysoev (is <> rambler-co dot ru)
  Tested by:	Igor Sysoev (is <> rambler-co dot ru)

Revision 1.198.2.30: download - view: text, markup, annotated - select for diffs
Thu Jan 21 00:46:54 2010 UTC (2 years ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.29: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.29: +22 -12 lines
SVN rev 202727 on 2010-01-21 00:46:54Z by yongari

MFC r202293:
  For controllers that has dual mode PHY(copper or fiber) interfaces
  over GMII, make sure to enable GMII. With this change brgphy(4) is
  used to handle the dual mode PHY. Since we still don't have a sane
  way to pass PHY specific information to mii(4) layer special
  handling is needed in brgphy(4) to determine which mode of PHY was
  configured in parent interface.
  This change make BCM5715S work.

  Tested by:	olli
  Obtained from:	OpenBSD
  PR:	kern/122551

Revision 1.226.2.14: download - view: text, markup, annotated - select for diffs
Thu Jan 21 00:45:12 2010 UTC (2 years ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.13: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.13: +22 -12 lines
SVN rev 202726 on 2010-01-21 00:45:12Z by yongari

MFC r202293:
  For controllers that has dual mode PHY(copper or fiber) interfaces
  over GMII, make sure to enable GMII. With this change brgphy(4) is
  used to handle the dual mode PHY. Since we still don't have a sane
  way to pass PHY specific information to mii(4) layer special
  handling is needed in brgphy(4) to determine which mode of PHY was
  configured in parent interface.
  This change make BCM5715S work.

  Tested by:	olli
  Obtained from:	OpenBSD
  PR:	kern/122551

Revision 1.270: download - view: text, markup, annotated - select for diffs
Fri Jan 15 17:55:18 2010 UTC (2 years ago) by yongari
Branches: MAIN
Diff to: previous 1.269: preferred, colored
Changes since revision 1.269: +2 -5 lines
SVN rev 202406 on 2010-01-15 17:55:18Z by yongari

Don't free mbuf chains when bge(4) fails to collapse the mbuf
chains. This part of code is to enhance performance so failing the
collapsing should not free TX frames. Otherwise bge(4) will
unnecessarily drop frames which in turn can freeze the network
connection.

Reported by:	Igor Sysoev (is <> rambler-co dot ru)
Tested by:	Igor Sysoev (is <> rambler-co dot ru)

Revision 1.269: download - view: text, markup, annotated - select for diffs
Thu Jan 14 19:08:43 2010 UTC (2 years ago) by yongari
Branches: MAIN
Diff to: previous 1.268: preferred, colored
Changes since revision 1.268: +22 -12 lines
SVN rev 202293 on 2010-01-14 19:08:43Z by yongari

For controllers that has dual mode PHY(copper or fiber) interfaces
over GMII, make sure to enable GMII. With this change brgphy(4) is
used to handle the dual mode PHY. Since we still don't have a sane
way to pass PHY specific information to mii(4) layer special
handling is needed in brgphy(4) to determine which mode of PHY was
configured in parent interface.
This change make BCM5715S work.

Tested by:	olli
Obtained from:	OpenBSD
MFC after:	1 week

Revision 1.268: download - view: text, markup, annotated - select for diffs
Wed Jan 13 22:39:39 2010 UTC (2 years ago) by delphij
Branches: MAIN
Diff to: previous 1.267: preferred, colored
Changes since revision 1.267: +3 -1 lines
SVN rev 202268 on 2010-01-13 22:39:39Z by delphij

 o Add PCI ID for BCM 5756.
 o Don't enable BGE_FLAG_BER_BUG on both 5722 and 5756, and based
   on their PCI IDs rather than their chip IDs.

Reported by:	several PC-BSD users via kmoore
Reviewed by:	yongari, imp, jhb, davidch
Sponsored by:	iXsystems, Inc.
MFC after:	2 weeks

Revision 1.198.2.29: download - view: text, markup, annotated - select for diffs
Thu Jan 7 00:57:40 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.28: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.28: +56 -32 lines
SVN rev 201707 on 2010-01-07 00:57:40Z by yongari

MFC r200088,200227-200228,200246,200264,201446

r200088:
  Add workaround to overcome hardware limitation which allows only a
  single outstanding DMA read operation. Most controllers targeted to
  client with PCIe bus interface(e.g. BCM5761) may have this
  limitation. All controllers for servers does not have this
  limitation.
  Collapsing mbuf chains to reduce number of memory reads before
  transmitting was most effective way to workaround this. I got about
  940Mbps from 850Mbps with mbuf collapsing on BCM5761. However it
  takes a lot of CPU cycles to collapse mbuf chains so add tunable to
  control the number of allowed TX buffers before collapsing. The
  default value is 0 which effectively disables the forced collapsing.
  For most cases 2 would yield best performance(about 930Mbps)
  without much sacrificing CPU cycles.
  Note the collapsing is only activated when the controller is on
  PCIe bus and the frame does not need TSO operation. TSO does not
  seem to suffer from the hardware limitation because the payload
  size is much bigger than normal IP datagram.
  Thanks to davidch@ who told me the limitation of client controllers
  and actually gave possible workarounds to mitigate the limitation.

r200227:
  Remove PHY isolate/power down code in bge_stop(). The isolation
  handler in brgphy(4) does not exist and brgphy(4) just resets the
  PHY and returns EINVAL as it has no isolation handler. I also agree
  on Marius's opinion that stop handler of every NIC driver seems to
  be the wrong place for implementing PHY isolate/power down.
  If we need PHY isolate/power down it should be implemented in
  brgphy(4) and users should administratively down the PHY.

r200228:
  Don't access jumbo frame related registers if controller lacks the
  feature. These registers are reserved on controllers that have no
  support for jumbo frame.
  Only BCM5700 has mini ring so do not poke mini ring related
  registers if controller is not BCM5700.

r200246:
  Partially revert r200228. For mini RCB case, bge(4) still have to
  disable mini ring withtout regard to mini ring support.

r200264:
  Create sysctl node(dev.bge.%d.focred_collapse) instead of
  hw.bge.forced_collapse. hw.bge.forced_collapse affects all bge(4)
  controllers on system which may not desirable behavior of the
  sysctl node. Also allow the sysctl node could be modified at any
  time.

r201446:
  Fix regression introduced in r198318. BCM5754/BCM5754M uses the
  same ASIC ID of BCM5758 such that r198318 incorecctly enabled TSO
  on BCM5754.BCM5754M controllers. BCM5754/BCM5754M needs a special
  firmware to enable TSO and bge(4) does not support firmware based
  TSO.

Revision 1.226.2.13: download - view: text, markup, annotated - select for diffs
Thu Jan 7 00:55:07 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.12: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.12: +56 -32 lines
SVN rev 201706 on 2010-01-07 00:55:07Z by yongari

MFC r200088,200227-200228,200246,200264,201446

r200088:
  Add workaround to overcome hardware limitation which allows only a
  single outstanding DMA read operation. Most controllers targeted to
  client with PCIe bus interface(e.g. BCM5761) may have this
  limitation. All controllers for servers does not have this
  limitation.
  Collapsing mbuf chains to reduce number of memory reads before
  transmitting was most effective way to workaround this. I got about
  940Mbps from 850Mbps with mbuf collapsing on BCM5761. However it
  takes a lot of CPU cycles to collapse mbuf chains so add tunable to
  control the number of allowed TX buffers before collapsing. The
  default value is 0 which effectively disables the forced collapsing.
  For most cases 2 would yield best performance(about 930Mbps)
  without much sacrificing CPU cycles.
  Note the collapsing is only activated when the controller is on
  PCIe bus and the frame does not need TSO operation. TSO does not
  seem to suffer from the hardware limitation because the payload
  size is much bigger than normal IP datagram.
  Thanks to davidch@ who told me the limitation of client controllers
  and actually gave possible workarounds to mitigate the limitation.

r200227:
  Remove PHY isolate/power down code in bge_stop(). The isolation
  handler in brgphy(4) does not exist and brgphy(4) just resets the
  PHY and returns EINVAL as it has no isolation handler. I also agree
  on Marius's opinion that stop handler of every NIC driver seems to
  be the wrong place for implementing PHY isolate/power down.
  If we need PHY isolate/power down it should be implemented in
  brgphy(4) and users should administratively down the PHY.

r200228:
  Don't access jumbo frame related registers if controller lacks the
  feature. These registers are reserved on controllers that have no
  support for jumbo frame.
  Only BCM5700 has mini ring so do not poke mini ring related
  registers if controller is not BCM5700.

r200246:
  Partially revert r200228. For mini RCB case, bge(4) still have to
  disable mini ring withtout regard to mini ring support.

r200264:
  Create sysctl node(dev.bge.%d.focred_collapse) instead of
  hw.bge.forced_collapse. hw.bge.forced_collapse affects all bge(4)
  controllers on system which may not desirable behavior of the
  sysctl node. Also allow the sysctl node could be modified at any
  time.

r201446:
  Fix regression introduced in r198318. BCM5754/BCM5754M uses the
  same ASIC ID of BCM5758 such that r198318 incorecctly enabled TSO
  on BCM5754.BCM5754M controllers. BCM5754/BCM5754M needs a special
  firmware to enable TSO and bge(4) does not support firmware based
  TSO.

Revision 1.198.2.28: download - view: text, markup, annotated - select for diffs
Thu Jan 7 00:48:10 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.27: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.27: +196 -38 lines
SVN rev 201704 on 2010-01-07 00:48:10Z by yongari

MFC r199670-199671,199674,199679,199761,199807-199808

r199670:
  Fix two long standing bugs on bge(4). Most pre BCM5755 controllers
  have a DMA bug when buffer address crosses a multiple of the 4GB
  boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within
  4GB address for these controllers. The second DMA bug limits DMA
  address to be within 40bit address space. This bug applies to
  BCM5714 and BCM5715 and 5708(bce(4) controller). This is not
  actually a MAC controller bug but an issue with the embedded PCIe
  to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers
  also limit the DMA address to be within 40bit address space.
  Special thanks to davidch@ who gave me detailed errata information.
  I think this change will fix long standing bge(4) instability
  issues on systems with more than 4GB memory.

r199671:
  Implement TSO for BCM5755 or newer controllers. Some controllers
  seem to require a special firmware to use TSO. But the firmware is
  not available to FreeBSD and Linux claims that the TSO performed by
  the firmware is slower than hardware based TSO. Moreover the
  firmware based TSO has one known bug which can't handle TSO if
  ethernet header + IP/TCP header is greater than 80 bytes. The
  workaround for the TSO bug exist but it seems it's too expensive
  than not using TSO at all. Some hardwares also have the TSO bug so
  limit the TSO to the controllers that are not affected TSO issues
  (e.g. 5755 or higher).
  While I'm here set VLAN tag bit to all descriptors that belengs to
  a frame instead of the first descriptor of a frame. The datasheet
  is not clear how to handle VLAN tag bit but it worked either way in
  my testing. This makes it simplify TSO configuration a little bit.

  Big thanks to davidch@ who sent me detailed TSO information.
  Without this I was not able to implement it.

r199674:
  Add missing function prototype in r199671.

r199679:
  Reduce status block size DMAed by controller. bge(4) uses single
  Tx/Rx/Rx return ring such that large part of status block was not
  used at all. All bge(4) controllers except BCM5700 AX/BX has a
  feature to control the size of status block. So use minimum status
  block size allowed in controller. This reduces number of DMAed
  status block size to 32 bytes from 80 bytes.

r199761:
  BGE_FLAG_40BIT_BUG should be set before creating DMA tags.

r199807:
  Make sure one shot MSI is enabled.

r199808:
  Fix typo which inversed the logic which in turn disabled MSI.

Revision 1.226.2.12: download - view: text, markup, annotated - select for diffs
Thu Jan 7 00:44:54 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.11: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.11: +196 -38 lines
SVN rev 201702 on 2010-01-07 00:44:54Z by yongari

MFC r199670-199671,199674,199679,199761,199807-199808

r199670:
  Fix two long standing bugs on bge(4). Most pre BCM5755 controllers
  have a DMA bug when buffer address crosses a multiple of the 4GB
  boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within
  4GB address for these controllers. The second DMA bug limits DMA
  address to be within 40bit address space. This bug applies to
  BCM5714 and BCM5715 and 5708(bce(4) controller). This is not
  actually a MAC controller bug but an issue with the embedded PCIe
  to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers
  also limit the DMA address to be within 40bit address space.
  Special thanks to davidch@ who gave me detailed errata information.
  I think this change will fix long standing bge(4) instability
  issues on systems with more than 4GB memory.

r199671:
  Implement TSO for BCM5755 or newer controllers. Some controllers
  seem to require a special firmware to use TSO. But the firmware is
  not available to FreeBSD and Linux claims that the TSO performed by
  the firmware is slower than hardware based TSO. Moreover the
  firmware based TSO has one known bug which can't handle TSO if
  ethernet header + IP/TCP header is greater than 80 bytes. The
  workaround for the TSO bug exist but it seems it's too expensive
  than not using TSO at all. Some hardwares also have the TSO bug so
  limit the TSO to the controllers that are not affected TSO issues
  (e.g. 5755 or higher).
  While I'm here set VLAN tag bit to all descriptors that belengs to
  a frame instead of the first descriptor of a frame. The datasheet
  is not clear how to handle VLAN tag bit but it worked either way in
  my testing. This makes it simplify TSO configuration a little bit.

  Big thanks to davidch@ who sent me detailed TSO information.
  Without this I was not able to implement it.

r199674:
  Add missing function prototype in r199671.

r199679:
  Reduce status block size DMAed by controller. bge(4) uses single
  Tx/Rx/Rx return ring such that large part of status block was not
  used at all. All bge(4) controllers except BCM5700 AX/BX has a
  feature to control the size of status block. So use minimum status
  block size allowed in controller. This reduces number of DMAed
  status block size to 32 bytes from 80 bytes.

r199761:
  BGE_FLAG_40BIT_BUG should be set before creating DMA tags.

r199807:
  Make sure one shot MSI is enabled.

r199808:
  Fix typo which inversed the logic which in turn disabled MSI.

Revision 1.198.2.27: download - view: text, markup, annotated - select for diffs
Thu Jan 7 00:04:29 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.26: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.26: +127 -26 lines
SVN rev 201699 on 2010-01-07 00:04:29Z by yongari

MFC r199667-199668

r199667:
  Cache Rx producer/Tx consumer index as soon as we know status block
  update and then clear status block. Previously it used to access
  these index without synchronization which may cause problems when
  bounce buffers are used. Also add missing bus_dmamap_sync(9) in
  polling handler. Since we now update status block in driver, adjust
  bus_dmamap_sync(9) for status block.

r199668:
  For MSI case, interrupt is not shared and we don't need to force
  PCI flush to get correct status block update. Add an optimized
  interrupt handler that is activated for MSI case. Actual interrupt
  handling is done by taskqueue such that the handler does not
  require driver lock for Rx path. The MSI capable bge(4) controllers
  automatically disables further interrupt once it enters interrupt
  state so we don't need PIO access to disable interrupt in interrupt
  handler.

Revision 1.198.2.26: download - view: text, markup, annotated - select for diffs
Wed Jan 6 23:57:17 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.25: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.25: +8 -7 lines
SVN rev 201698 on 2010-01-06 23:57:17Z by yongari

MFC r196370:
  - Do not try to reevaluate current RX production index on each
    loop iteration as it can be updated by the card while we
    process the RX ring forcing us to process RX descriptors
    for which DMA synchronisation operation has not been
    performed.  This fixes the bug when bge(4) drops packets
    under high load.

Revision 1.226.2.11: download - view: text, markup, annotated - select for diffs
Wed Jan 6 23:42:15 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.10: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.10: +127 -26 lines
SVN rev 201697 on 2010-01-06 23:42:15Z by yongari

MFC r199667-199668

r199667:
  Cache Rx producer/Tx consumer index as soon as we know status block
  update and then clear status block. Previously it used to access
  these index without synchronization which may cause problems when
  bounce buffers are used. Also add missing bus_dmamap_sync(9) in
  polling handler. Since we now update status block in driver, adjust
  bus_dmamap_sync(9) for status block.

r199668:
  For MSI case, interrupt is not shared and we don't need to force
  PCI flush to get correct status block update. Add an optimized
  interrupt handler that is activated for MSI case. Actual interrupt
  handling is done by taskqueue such that the handler does not
  require driver lock for Rx path. The MSI capable bge(4) controllers
  automatically disables further interrupt once it enters interrupt
  state so we don't need PIO access to disable interrupt in interrupt
  handler.

Revision 1.198.2.25: download - view: text, markup, annotated - select for diffs
Wed Jan 6 23:37:13 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.24: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.24: +66 -75 lines
SVN rev 201696 on 2010-01-06 23:37:13Z by yongari

MFC 199663-199666

r199663:
  Due to newly added PCIe capabilities fallback code for finding the
  PCIe capability did not work right on recent controllers. Remove
  FreeBSD 6.x support code.

r199664:
  Use capability pointer to access PCIe registers rather than
  directly access them at fixed address. While I'm here don't touch
  other bits of PCIe device control register except max payload size.

r199665:
  Controller does not write Rx descriptors, remove BUS_DMASYNC_PREREAD.

r199666:
  Rearrange bge_start_locked to see we can send more frames by
  checking IFF_DRV_RUNNING and IFF_DRV_OACTIVE flags. Also if we
  have less than 16 free send BDs set IFF_DRV_OACTIVE and try it
  later. Previously bge(4) used to reserve 16 free send BDs after
  loading dma maps but hardware just need one reserved send BD. If
  prouder index has the same value of consumer index it means the Tx
  queue is empty.
  While I'm here check IFQ_DRV_IS_EMPTY first to save one lock
  operation.

Revision 1.226.2.10: download - view: text, markup, annotated - select for diffs
Wed Jan 6 23:34:53 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.9: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.9: +66 -75 lines
SVN rev 201694 on 2010-01-06 23:34:53Z by yongari

MFC 199663-199666

r199663:
  Due to newly added PCIe capabilities fallback code for finding the
  PCIe capability did not work right on recent controllers. Remove
  FreeBSD 6.x support code.

r199664:
  Use capability pointer to access PCIe registers rather than
  directly access them at fixed address. While I'm here don't touch
  other bits of PCIe device control register except max payload size.

r199665:
  Controller does not write Rx descriptors, remove BUS_DMASYNC_PREREAD.

r199666:
  Rearrange bge_start_locked to see we can send more frames by
  checking IFF_DRV_RUNNING and IFF_DRV_OACTIVE flags. Also if we
  have less than 16 free send BDs set IFF_DRV_OACTIVE and try it
  later. Previously bge(4) used to reserve 16 free send BDs after
  loading dma maps but hardware just need one reserved send BD. If
  prouder index has the same value of consumer index it means the Tx
  queue is empty.
  While I'm here check IFQ_DRV_IS_EMPTY first to save one lock
  operation.

Revision 1.198.2.24: download - view: text, markup, annotated - select for diffs
Wed Jan 6 23:28:39 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.23: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.23: +23 -16 lines
SVN rev 201693 on 2010-01-06 23:28:39Z by yongari

MFC r199065,199115-199116,199153,199661-199662

r199065:
  Correct disabling checksum offloading for BCM5700 B0.

r199115:
  Add missing bus_dmamap_sync(9) before issuing kick command.

r199116:
  Zero out Tx/Rx descriptors before using them. Also add missing
  bus_dmamap_sync(9) after Tx descriptor initialization.

r199153:
  Controller does not update Tx descriptors(send BDs) after sending
  frames so remove unnecessary BUS_DMASYNC_PREREAD and
  BUS_DMASYNC_POSTREAD of bus_dmamap_sync(9).

r199661:
  Remove extra white space.

r199662:
  Fix typo introduced in r199011.

Revision 1.226.2.9: download - view: text, markup, annotated - select for diffs
Wed Jan 6 23:26:09 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.8: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.8: +23 -16 lines
SVN rev 201692 on 2010-01-06 23:26:09Z by yongari

MFC r199065,199115-199116,199153,199661-199662

r199065:
  Correct disabling checksum offloading for BCM5700 B0.

r199115:
  Add missing bus_dmamap_sync(9) before issuing kick command.

r199116:
  Zero out Tx/Rx descriptors before using them. Also add missing
  bus_dmamap_sync(9) after Tx descriptor initialization.

r199153:
  Controller does not update Tx descriptors(send BDs) after sending
  frames so remove unnecessary BUS_DMASYNC_PREREAD and
  BUS_DMASYNC_POSTREAD of bus_dmamap_sync(9).

r199661:
  Remove extra white space.

r199662:
  Fix typo introduced in r199011.

Revision 1.198.2.23: download - view: text, markup, annotated - select for diffs
Wed Jan 6 23:15:07 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.22: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.22: +102 -86 lines
SVN rev 201691 on 2010-01-06 23:15:07Z by yongari

MFC r198967,199009-199011,199014,199020,199035-199036,199054

r198967:
  Correct MSI mode register bits.

r199009:
  bge(4) already switched to use UMA backed page allocator and local
  memory allocator for jumbo frame was removed long time ago. Remove
  no more used macros.

r199010:
  Do bus_dmamap_sync call only if frame size is greater than
  standard buffer size. If controller is not capable of handling
  jumbo frame, interface MTU couldn't be larger than standard MTU
  which in turn the received should be fit in standard buffer. This
  fixes bus_dmamap_sync call for jumbo ring is called even if
  interface is configured to use standard MTU.
  Also if total frame size could be fit into standard buffer don't
  use jumbo buffers.

r199011:
  Reimplement Rx buffer allocation to handle dma map load failure.
  Introduce two spare dma maps for standard buffer and jumbo buffer
  respectively. If loading a dma map failed reuse previously loaded
  dma map. This should fix unloaded dma map is used in case of dma
  map load failure. Also don't blindly unload dma map and defer
  dma map sync and unloading operation until we know dma map for new
  buffer is successfully loaded. This change saves unnecessary dma
  load/unload operation. Previously bge(4) tried to reuse mbuf
  with unloaded dma map which is really bad thing in bus_dma(9)
  perspective.
  While I'm here update if_iqdrops if we can't allocate Rx buffers.

r199014:
  Fix I mssied in r199011. Rx ring index also should be updated.
  If we fill Rx ring full instead of half we can simplify this logic
  but this requires more experimentation.

r199020:
  Tell upper layer we support long frames. ether_ifattach()
  initializes it to ETHER_HDR_LEN so we have to override it after
  calling ether_ifattch().
  While I'm here remove setting if_mtu value, it's initialized in
  ether_ifattach().

r199035:
  Don't count input errors twice, we always read input errors from
  MAC in bge_tick. Previously it used to show more number of input
  errors. I noticed actual input errors were less than 8% even for
  64 bytes UDP frames generated by netperf.
  Since we always access BGE_RXLP_LOCSTAT_IFIN_DROPS register in
  bge_tick, remove useless code protected by #ifdef notyet.

r199036:
  Count number of inbound packets which were chosen to be discarded
  as input errors. Also count out of receive BDs as input errors.

r199054:
  Partially revert r199035.
  Revision 1.158 says only lower ten bits of
  BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it
  seems the controller maintains 16bits value for the register.
  However 16bits are still too small to count all dropped packets
  happened in a second. To get a correct counter we have to read the
  register in bge_rxeof() which would be too expensive.

Revision 1.226.2.8: download - view: text, markup, annotated - select for diffs
Wed Jan 6 23:02:35 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.7: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.7: +102 -86 lines
SVN rev 201687 on 2010-01-06 23:02:35Z by yongari

MFC r198967,199009-199011,199014,199020,199035-199036,199054

r198967:
  Correct MSI mode register bits.

r199009:
  bge(4) already switched to use UMA backed page allocator and local
  memory allocator for jumbo frame was removed long time ago. Remove
  no more used macros.

r199010:
  Do bus_dmamap_sync call only if frame size is greater than
  standard buffer size. If controller is not capable of handling
  jumbo frame, interface MTU couldn't be larger than standard MTU
  which in turn the received should be fit in standard buffer. This
  fixes bus_dmamap_sync call for jumbo ring is called even if
  interface is configured to use standard MTU.
  Also if total frame size could be fit into standard buffer don't
  use jumbo buffers.

r199011:
  Reimplement Rx buffer allocation to handle dma map load failure.
  Introduce two spare dma maps for standard buffer and jumbo buffer
  respectively. If loading a dma map failed reuse previously loaded
  dma map. This should fix unloaded dma map is used in case of dma
  map load failure. Also don't blindly unload dma map and defer
  dma map sync and unloading operation until we know dma map for new
  buffer is successfully loaded. This change saves unnecessary dma
  load/unload operation. Previously bge(4) tried to reuse mbuf
  with unloaded dma map which is really bad thing in bus_dma(9)
  perspective.
  While I'm here update if_iqdrops if we can't allocate Rx buffers.

r199014:
  Fix I mssied in r199011. Rx ring index also should be updated.
  If we fill Rx ring full instead of half we can simplify this logic
  but this requires more experimentation.

r199020:
  Tell upper layer we support long frames. ether_ifattach()
  initializes it to ETHER_HDR_LEN so we have to override it after
  calling ether_ifattch().
  While I'm here remove setting if_mtu value, it's initialized in
  ether_ifattach().

r199035:
  Don't count input errors twice, we always read input errors from
  MAC in bge_tick. Previously it used to show more number of input
  errors. I noticed actual input errors were less than 8% even for
  64 bytes UDP frames generated by netperf.
  Since we always access BGE_RXLP_LOCSTAT_IFIN_DROPS register in
  bge_tick, remove useless code protected by #ifdef notyet.

r199036:
  Count number of inbound packets which were chosen to be discarded
  as input errors. Also count out of receive BDs as input errors.

r199054:
  Partially revert r199035.
  Revision 1.158 says only lower ten bits of
  BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it
  seems the controller maintains 16bits value for the register.
  However 16bits are still too small to count all dropped packets
  happened in a second. To get a correct counter we have to read the
  register in bge_rxeof() which would be too expensive.

Revision 1.198.2.22: download - view: text, markup, annotated - select for diffs
Wed Jan 6 22:49:10 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_7
Diff to: previous 1.198.2.21: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.21: +70 -52 lines
SVN rev 201686 on 2010-01-06 22:49:10Z by yongari

MFC r198923-198924,198927-198928

r198923:
  Use correct dma tag for jumbo buffer.

r198924:
  Covert bge_newbuf_std to use bus_dmamap_load_mbuf_sg(9). Note,
  bge_newbuf_std still has a bug for handling dma map load failure
  under high network load. Just reusing mbuf is not enough as driver
  already unloaded the dma map of the mbuf. Graceful recovery needs
  more work.
  Ideally we can just update dma address part of a Rx descriptor
  because the controller never overwrite the Rx descriptor. This
  requires some Rx initialization code changes and it would be done
  later after fixing other incorrect bus_dma(9) usages.

r198927:
  Remove common DMA tag used for TX/RX mbufs and create Tx DMA tag
  and Rx DMA tag separately. Previously it used a common mbuf DMA tag
  for both Tx and Rx path but Rx buffer(standard ring case) should
  have a single DMA segment and maximum buffer size of the segment
  should be less than or equal to MCLBYTES. This change also make it
  possible to add TSO with minor changes.

r198928:
  Make bge_newbuf_std()/bge_newbuf_jumbo() returns actual error code
  for buffer allocation. If driver know we are out of Rx buffers let
  controller stop. This should fix panic when interface is run even
  if it had no configured Rx buffers.

Revision 1.226.2.7: download - view: text, markup, annotated - select for diffs
Wed Jan 6 22:45:49 2010 UTC (2 years, 1 month ago) by yongari
Branches: RELENG_8
Diff to: previous 1.226.2.6: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.6: +70 -52 lines
SVN rev 201685 on 2010-01-06 22:45:49Z by yongari

MFC r198923-198924,198927-198928

r198923:
  Use correct dma tag for jumbo buffer.

r198924:
  Covert bge_newbuf_std to use bus_dmamap_load_mbuf_sg(9). Note,
  bge_newbuf_std still has a bug for handling dma map load failure
  under high network load. Just reusing mbuf is not enough as driver
  already unloaded the dma map of the mbuf. Graceful recovery needs
  more work.
  Ideally we can just update dma address part of a Rx descriptor
  because the controller never overwrite the Rx descriptor. This
  requires some Rx initialization code changes and it would be done
  later after fixing other incorrect bus_dma(9) usages.

r198927:
  Remove common DMA tag used for TX/RX mbufs and create Tx DMA tag
  and Rx DMA tag separately. Previously it used a common mbuf DMA tag
  for both Tx and Rx path but Rx buffer(standard ring case) should
  have a single DMA segment and maximum buffer size of the segment
  should be less than or equal to MCLBYTES. This change also make it
  possible to add TSO with minor changes.

r198928:
  Make bge_newbuf_std()/bge_newbuf_jumbo() returns actual error code
  for buffer allocation. If driver know we are out of Rx buffers let
  controller stop. This should fix panic when interface is run even
  if it had no configured Rx buffers.

Revision 1.267: download - view: text, markup, annotated - select for diffs
Sun Jan 3 21:49:24 2010 UTC (2 years, 1 month ago) by yongari
Branches: MAIN
Diff to: previous 1.266: preferred, colored
Changes since revision 1.266: +9 -2 lines
SVN rev 201446 on 2010-01-03 21:49:24Z by yongari

Fix regression introduced in r198318. BCM5754/BCM5754M uses the
same ASIC ID of BCM5758 such that r198318 incorecctly enabled TSO
on BCM5754.BCM5754M controllers. BCM5754/BCM5754M needs a special
firmware to enable TSO and bge(4) does not support firmware based
TSO.

Reported by:	ed
Tested by:	ed

Revision 1.198.2.21: download - view: text, markup, annotated - select for diffs
Tue Dec 15 10:36:08 2009 UTC (2 years, 1 month ago) by stas
Branches: RELENG_7
Diff to: previous 1.198.2.20: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.20: +7 -4 lines
SVN rev 200571 on 2009-12-15 10:36:08Z by stas

- MFC r198318:
  - On entrance to the rx_eof sync RX rings maps with POSTWRITE flag
    instead of POSTREAD: the hardware do not touch this memory (CPU
    updates it).  It is already synchronized as PREWRITE after the
    processing is done.

  - Synchronize RX return ring memory in rx_eof.  This is needed
    as the deviced updates this memory when receives packets.

  - Decouple the synchronization of BGE status block in the interrupt
    service routine: perfrom PREREAD synchronization only all accesses
    to this block are finished.  This seems to be more natural.

Revision 1.198.2.20: download - view: text, markup, annotated - select for diffs
Tue Dec 15 10:34:05 2009 UTC (2 years, 1 month ago) by stas
Branches: RELENG_7
Diff to: previous 1.198.2.19: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.19: +68 -14 lines
SVN rev 200570 on 2009-12-15 10:34:05Z by stas

- MFC r197832, r197834, r197837:
  - Add support for new BGE chips (5761, 5784 and 57780).  These chips uses new
    BGE_PCI_PRODID_ASICREV register to store the chip identifier and its revision.
  - Add new grouping macro for 7575+ chips (BGE_IS_5755_PLUS).
  - Add IDs for Fujitsu-branded Broadcom adapters.
> PR:            If a GNATS PR is affected by the change.
> Submitted by:  If someone else sent in the change.
> Reviewed by:   If someone else reviewed your modification.
> Approved by:   If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
> Security:      Vulnerability reference (one per line) or description.
> Empty fields above will be automatically removed.

_M   7/share/man/man4
M    7/share/man/man4/bge.4
_M   7/sys
M    7/sys/dev/bge/if_bgereg.h
M    7/sys/dev/bge/if_bge.c
_M   7/sys/contrib/pf
_M   7/sys/contrib/dev/acpica
_M   7/sys/cddl/contrib/opensolaris

Revision 1.226.2.6: download - view: text, markup, annotated - select for diffs
Tue Dec 15 10:16:57 2009 UTC (2 years, 1 month ago) by stas
Branches: RELENG_8
Diff to: previous 1.226.2.5: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.5: +7 -4 lines
SVN rev 200569 on 2009-12-15 10:16:57Z by stas

MFC r198318:
  - On entrance to the rx_eof sync RX rings maps with POSTWRITE flag
    instead of POSTREAD: the hardware do not touch this memory (CPU
    updates it).  It is already synchronized as PREWRITE after the
    processing is done.

Revision 1.226.2.5: download - view: text, markup, annotated - select for diffs
Tue Dec 15 10:00:00 2009 UTC (2 years, 1 month ago) by stas
Branches: RELENG_8
Diff to: previous 1.226.2.4: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.4: +68 -14 lines
SVN rev 200568 on 2009-12-15 10:00:00Z by stas

- MFC r197832, r197834, r197837:
  - Add support for new BGE chips (5761, 5784 and 57780).  These chips uses new
    BGE_PCI_PRODID_ASICREV register to store the chip identifier and its revision.
  - Add new grouping macro for 7575+ chips (BGE_IS_5755_PLUS).
  - Add IDs for Fujitsu-branded Broadcom adapters.

Revision 1.266: download - view: text, markup, annotated - select for diffs
Tue Dec 8 17:54:23 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.265: preferred, colored
Changes since revision 1.265: +24 -21 lines
SVN rev 200264 on 2009-12-08 17:54:23Z by yongari

Create sysctl node(dev.bge.%d.focred_collapse) instead of
hw.bge.forced_collapse. hw.bge.forced_collapse affects all bge(4)
controllers on system which may not desirable behavior of the
sysctl node. Also allow the sysctl node could be modified at any
time.

Reviewed by:	bde (initial version)

Revision 1.265: download - view: text, markup, annotated - select for diffs
Tue Dec 8 03:24:29 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.264: preferred, colored
Changes since revision 1.264: +5 -7 lines
SVN rev 200246 on 2009-12-08 03:24:29Z by yongari

Partially revert r200228. For mini RCB case, bge(4) still have to
disable mini ring withtout regard to mini ring support.

Reported by:	marcel
Tested by:	marcel

Revision 1.264: download - view: text, markup, annotated - select for diffs
Mon Dec 7 19:26:54 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.263: preferred, colored
Changes since revision 1.263: +14 -8 lines
SVN rev 200228 on 2009-12-07 19:26:54Z by yongari

Don't access jumbo frame related registers if controller lacks the
feature. These registers are reserved on controllers that have no
support for jumbo frame.
Only BCM5700 has mini ring so do not poke mini ring related
registers if controller is not BCM5700.

Reviewed by:	marius

Revision 1.263: download - view: text, markup, annotated - select for diffs
Mon Dec 7 19:18:23 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.262: preferred, colored
Changes since revision 1.262: +0 -27 lines
SVN rev 200227 on 2009-12-07 19:18:23Z by yongari

Remove PHY isolate/power down code in bge_stop(). The isolation
handler in brgphy(4) does not exist and brgphy(4) just resets the
PHY and returns EINVAL as it has no isolation handler. I also agree
on Marius's opinion that stop handler of every NIC driver seems to
be the wrong place for implementing PHY isolate/power down.
If we need PHY isolate/power down it should be implemented in
brgphy(4) and users should administratively down the PHY.

Reviewed by:	marius

Revision 1.262: download - view: text, markup, annotated - select for diffs
Thu Dec 3 23:57:06 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.261: preferred, colored
Changes since revision 1.261: +37 -0 lines
SVN rev 200088 on 2009-12-03 23:57:06Z by yongari

Add workaround to overcome hardware limitation which allows only a
single outstanding DMA read operation. Most controllers targeted to
client with PCIe bus interface(e.g. BCM5761) may have this
limitation. All controllers for servers does not have this
limitation.
Collapsing mbuf chains to reduce number of memory reads before
transmitting was most effective way to workaround this. I got about
940Mbps from 850Mbps with mbuf collapsing on BCM5761. However it
takes a lot of CPU cycles to collapse mbuf chains so add tunable to
control the number of allowed TX buffers before collapsing. The
default value is 0 which effectively disables the forced collapsing.
For most cases 2 would yield best performance(about 930Mbps)
without much sacrificing CPU cycles.
Note the collapsing is only activated when the controller is on
PCIe bus and the frame does not need TSO operation. TSO does not
seem to suffer from the hardware limitation because the payload
size is much bigger than normal IP datagram.
Thanks to davidch@ who told me the limitation of client controllers
and actually gave possible workarounds to mitigate the limitation.

Reviewed by:	davidch, marius

Revision 1.261: download - view: text, markup, annotated - select for diffs
Wed Nov 25 17:51:14 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +1 -1 lines
SVN rev 199808 on 2009-11-25 17:51:14Z by yongari

Fix typo which inversed the logic which in turn disabled MSI.

Pointy hat to:  yongari

Revision 1.260: download - view: text, markup, annotated - select for diffs
Wed Nov 25 17:30:38 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +2 -0 lines
SVN rev 199807 on 2009-11-25 17:30:38Z by yongari

Make sure one shot MSI is enabled.

Submitted by:	marius

Revision 1.259: download - view: text, markup, annotated - select for diffs
Tue Nov 24 17:46:58 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.258: preferred, colored
Changes since revision 1.258: +7 -7 lines
SVN rev 199761 on 2009-11-24 17:46:58Z by yongari

BGE_FLAG_40BIT_BUG should be set before creating DMA tags.

Pointy hat to:  yongari

Revision 1.258: download - view: text, markup, annotated - select for diffs
Sun Nov 22 21:45:55 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +26 -8 lines
SVN rev 199679 on 2009-11-22 21:45:55Z by yongari

Reduce status block size DMAed by controller. bge(4) uses single
Tx/Rx/Rx return ring such that large part of status block was not
used at all. All bge(4) controllers except BCM5700 AX/BX has a
feature to control the size of status block. So use minimum status
block size allowed in controller. This reduces number of DMAed
status block size to 32 bytes from 80 bytes.

Revision 1.257: download - view: text, markup, annotated - select for diffs
Sun Nov 22 21:20:26 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.256: preferred, colored
Changes since revision 1.256: +2 -0 lines
SVN rev 199674 on 2009-11-22 21:20:26Z by yongari

Add missing function prototype in r199671.

Revision 1.256: download - view: text, markup, annotated - select for diffs
Sun Nov 22 21:16:30 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.255: preferred, colored
Changes since revision 1.255: +142 -29 lines
SVN rev 199671 on 2009-11-22 21:16:30Z by yongari

Implement TSO for BCM5755 or newer controllers. Some controllers
seem to require a special firmware to use TSO. But the firmware is
not available to FreeBSD and Linux claims that the TSO performed by
the firmware is slower than hardware based TSO. Moreover the
firmware based TSO has one known bug which can't handle TSO if
ethernet header + IP/TCP header is greater than 80 bytes. The
workaround for the TSO bug exist but it seems it's too expensive
than not using TSO at all. Some hardwares also have the TSO bug so
limit the TSO to the controllers that are not affected TSO issues
(e.g. 5755 or higher).
While I'm here set VLAN tag bit to all descriptors that belengs to
a frame instead of the first descriptor of a frame. The datasheet
is not clear how to handle VLAN tag bit but it worked either way in
my testing. This makes it simplify TSO configuration a little bit.

Big thanks to davidch@ who sent me detailed TSO information.
Without this I was not able to implement it.

Tested by:	current

Revision 1.255: download - view: text, markup, annotated - select for diffs
Sun Nov 22 20:50:27 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +24 -1 lines
SVN rev 199670 on 2009-11-22 20:50:27Z by yongari

Fix two long standing bugs on bge(4). Most pre BCM5755 controllers
have a DMA bug when buffer address crosses a multiple of the 4GB
boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within
4GB address for these controllers. The second DMA bug limits DMA
address to be within 40bit address space. This bug applies to
BCM5714 and BCM5715 and 5708(bce(4) controller). This is not
actually a MAC controller bug but an issue with the embedded PCIe
to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers
also limit the DMA address to be within 40bit address space.
Special thanks to davidch@ who gave me detailed errata information.
I think this change will fix long standing bge(4) instability
issues on systems with more than 4GB memory.

Reviewed by:	davidch

Revision 1.254: download - view: text, markup, annotated - select for diffs
Sun Nov 22 20:31:40 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.253: preferred, colored
Changes since revision 1.253: +104 -10 lines
SVN rev 199668 on 2009-11-22 20:31:40Z by yongari

For MSI case, interrupt is not shared and we don't need to force
PCI flush to get correct status block update. Add an optimized
interrupt handler that is activated for MSI case. Actual interrupt
handling is done by taskqueue such that the handler does not
require driver lock for Rx path. The MSI capable bge(4) controllers
automatically disables further interrupt once it enters interrupt
state so we don't need PIO access to disable interrupt in interrupt
handler.

Revision 1.253: download - view: text, markup, annotated - select for diffs
Sun Nov 22 20:02:13 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +27 -20 lines
SVN rev 199667 on 2009-11-22 20:02:13Z by yongari

Cache Rx producer/Tx consumer index as soon as we know status block
update and then clear status block. Previously it used to access
these index without synchronization which may cause problems when
bounce buffers are used. Also add missing bus_dmamap_sync(9) in
polling handler. Since we now update status block in driver, adjust
bus_dmamap_sync(9) for status block.

Revision 1.252: download - view: text, markup, annotated - select for diffs
Sun Nov 22 19:44:11 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +26 -24 lines
SVN rev 199666 on 2009-11-22 19:44:11Z by yongari

Rearrange bge_start_locked to see we can send more frames by
checking IFF_DRV_RUNNING and IFF_DRV_OACTIVE flags. Also if we
have less than 16 free send BDs set IFF_DRV_OACTIVE and try it
later. Previously bge(4) used to reserve 16 free send BDs after
loading dma maps but hardware just need one reserved send BD. If
prouder index has the same value of consumer index it means the Tx
queue is empty.
While I'm here check IFQ_DRV_IS_EMPTY first to save one lock
operation.

Revision 1.251: download - view: text, markup, annotated - select for diffs
Sun Nov 22 19:17:32 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +2 -4 lines
SVN rev 199665 on 2009-11-22 19:17:32Z by yongari

Controller does not write Rx descriptors, remove BUS_DMASYNC_PREREAD.

Revision 1.250: download - view: text, markup, annotated - select for diffs
Sun Nov 22 19:11:34 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +42 -31 lines
SVN rev 199664 on 2009-11-22 19:11:34Z by yongari

Use capability pointer to access PCIe registers rather than
directly access them at fixed address. While I'm here don't touch
other bits of PCIe device control register except max payload size.

Reviewed by:	marius

Revision 1.249: download - view: text, markup, annotated - select for diffs
Sun Nov 22 18:47:56 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +17 -37 lines
SVN rev 199663 on 2009-11-22 18:47:56Z by yongari

Due to newly added PCIe capabilities fallback code for finding the
PCIe capability did not work right on recent controllers. Remove
FreeBSD 6.x support code.

Reviewed by:	marius

Revision 1.248: download - view: text, markup, annotated - select for diffs
Sun Nov 22 18:34:15 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.247: preferred, colored
Changes since revision 1.247: +1 -1 lines
SVN rev 199662 on 2009-11-22 18:34:15Z by yongari

Fix typo introduced in r199011.

Pointed out by:	marius

Revision 1.247: download - view: text, markup, annotated - select for diffs
Sun Nov 22 18:30:19 2009 UTC (2 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +12 -12 lines
SVN rev 199661 on 2009-11-22 18:30:19Z by yongari

Remove extra white space.

Revision 1.91.2.39: download - view: text, markup, annotated - select for diffs
Tue Nov 17 20:49:09 2009 UTC (2 years, 2 months ago) by bz
Branches: RELENG_6
Diff to: previous 1.91.2.38: preferred, colored; branchpoint 1.91: preferred, colored; next MAIN 1.92: preferred, colored
Changes since revision 1.91.2.38: +10 -10 lines
SVN rev 199434 on 2009-11-17 20:49:09Z by bz

MFC r198049:

  Immediately after clearing a pending callout that didn't make it due
  to the lock we hold, disable interrupts, and announce to the firmware
  that we are shutting down. Especially do this before disabling blocks.

  This makes some types of machines with asf enabled no longer hang upon
  boot, when we start configuring the interface.

PR:	i386/96382, kern/100410, kern/122252, kern/116328

Revision 1.198.2.19: download - view: text, markup, annotated - select for diffs
Tue Nov 17 20:48:32 2009 UTC (2 years, 2 months ago) by bz
Branches: RELENG_7
Diff to: previous 1.198.2.18: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.18: +10 -10 lines
SVN rev 199433 on 2009-11-17 20:48:32Z by bz

MFC r198049:

  Immediately after clearing a pending callout that didn't make it due
  to the lock we hold, disable interrupts, and announce to the firmware
  that we are shutting down. Especially do this before disabling blocks.

  This makes some types of machines with asf enabled no longer hang upon
  boot, when we start configuring the interface.

PR:	i386/96382, kern/100410, kern/122252, kern/116328

Revision 1.226.2.4: download - view: text, markup, annotated - select for diffs
Tue Nov 17 14:30:09 2009 UTC (2 years, 2 months ago) by bz
Branches: RELENG_8
Diff to: previous 1.226.2.3: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.3: +10 -10 lines
SVN rev 199381 on 2009-11-17 14:30:09Z by bz

MFC r198049:

  Immediately after clearing a pending callout that didn't make it due
  to the lock we hold, disable interrupts, and announce to the firmware
  that we are shutting down. Especially do this before disabling blocks.

  This makes some types of machines with asf enabled no longer hang upon
  boot, when we start configuring the interface.

PR:	i386/96382, kern/100410, kern/122252, kern/116328

Revision 1.246: download - view: text, markup, annotated - select for diffs
Tue Nov 10 20:29:20 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +3 -6 lines
SVN rev 199153 on 2009-11-10 20:29:20Z by yongari

Controller does not update Tx descriptors(send BDs) after sending
frames so remove unnecessary BUS_DMASYNC_PREREAD and
BUS_DMASYNC_POSTREAD of bus_dmamap_sync(9).

Revision 1.245: download - view: text, markup, annotated - select for diffs
Mon Nov 9 23:09:18 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +7 -0 lines
SVN rev 199116 on 2009-11-09 23:09:18Z by yongari

Zero out Tx/Rx descriptors before using them. Also add missing
bus_dmamap_sync(9) after Tx descriptor initialization.

Revision 1.244: download - view: text, markup, annotated - select for diffs
Mon Nov 9 22:58:30 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +3 -0 lines
SVN rev 199115 on 2009-11-09 22:58:30Z by yongari

Add missing bus_dmamap_sync(9) before issuing kick command.

Revision 1.243: download - view: text, markup, annotated - select for diffs
Mon Nov 9 00:16:50 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +1 -1 lines
SVN rev 199065 on 2009-11-09 00:16:50Z by yongari

Correct disabling checksum offloading for BCM5700 B0.

Revision 1.242: download - view: text, markup, annotated - select for diffs
Sun Nov 8 19:59:54 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +8 -0 lines
SVN rev 199054 on 2009-11-08 19:59:54Z by yongari

Partially revert r199035.
Revision 1.158 says only lower ten bits of
BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it
seems the controller maintains 16bits value for the register.
However 16bits are still too small to count all dropped packets
happened in a second. To get a correct counter we have to read the
register in bge_rxeof() which would be too expensive.

Pointed out by:	bde

Revision 1.241: download - view: text, markup, annotated - select for diffs
Sun Nov 8 01:30:35 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +2 -0 lines
SVN rev 199036 on 2009-11-08 01:30:35Z by yongari

Count number of inbound packets which were chosen to be discarded
as input errors. Also count out of receive BDs as input errors.

Revision 1.240: download - view: text, markup, annotated - select for diffs
Sun Nov 8 01:13:38 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +0 -10 lines
SVN rev 199035 on 2009-11-08 01:13:38Z by yongari

Don't count input errors twice, we always read input errors from
MAC in bge_tick. Previously it used to show more number of input
errors. I noticed actual input errors were less than 8% even for
64 bytes UDP frames generated by netperf.
Since we always access BGE_RXLP_LOCSTAT_IFIN_DROPS register in
bge_tick, remove useless code protected by #ifdef notyet.

Revision 1.239: download - view: text, markup, annotated - select for diffs
Sat Nov 7 20:37:38 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +3 -1 lines
SVN rev 199020 on 2009-11-07 20:37:38Z by yongari

Tell upper layer we support long frames. ether_ifattach()
initializes it to ETHER_HDR_LEN so we have to override it after
calling ether_ifattch().
While I'm here remove setting if_mtu value, it's initialized in
ether_ifattach().

Revision 1.238: download - view: text, markup, annotated - select for diffs
Sat Nov 7 02:10:59 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +6 -0 lines
SVN rev 199014 on 2009-11-07 02:10:59Z by yongari

Fix I mssied in r199011. Rx ring index also should be updated.
If we fill Rx ring full instead of half we can simplify this logic
but this requires more experimentation.

Revision 1.237: download - view: text, markup, annotated - select for diffs
Sat Nov 7 01:01:33 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +86 -80 lines
SVN rev 199011 on 2009-11-07 01:01:33Z by yongari

Reimplement Rx buffer allocation to handle dma map load failure.
Introduce two spare dma maps for standard buffer and jumbo buffer
respectively. If loading a dma map failed reuse previously loaded
dma map. This should fix unloaded dma map is used in case of dma
map load failure. Also don't blindly unload dma map and defer
dma map sync and unloading operation until we know dma map for new
buffer is successfully loaded. This change saves unnecessary dma
load/unload operation. Previously bge(4) tried to reuse mbuf
with unloaded dma map which is really bad thing in bus_dma(9)
perspective.
While I'm here update if_iqdrops if we can't allocate Rx buffers.

Revision 1.236: download - view: text, markup, annotated - select for diffs
Fri Nov 6 23:49:20 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +5 -3 lines
SVN rev 199010 on 2009-11-06 23:49:20Z by yongari

Do bus_dmamap_sync call only if frame size is greater than
standard buffer size. If controller is not capable of handling
jumbo frame, interface MTU couldn't be larger than standard MTU
which in turn the received should be fit in standard buffer. This
fixes bus_dmamap_sync call for jumbo ring is called even if
interface is configured to use standard MTU.
Also if total frame size could be fit into standard buffer don't
use jumbo buffers.

Revision 1.235: download - view: text, markup, annotated - select for diffs
Wed Nov 4 21:06:54 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +20 -13 lines
SVN rev 198928 on 2009-11-04 21:06:54Z by yongari

Make bge_newbuf_std()/bge_newbuf_jumbo() returns actual error code
for buffer allocation. If driver know we are out of Rx buffers let
controller stop. This should fix panic when interface is run even
if it had no configured Rx buffers.

Revision 1.234: download - view: text, markup, annotated - select for diffs
Wed Nov 4 20:57:52 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +39 -25 lines
SVN rev 198927 on 2009-11-04 20:57:52Z by yongari

Remove common DMA tag used for TX/RX mbufs and create Tx DMA tag
and Rx DMA tag separately. Previously it used a common mbuf DMA tag
for both Tx and Rx path but Rx buffer(standard ring case) should
have a single DMA segment and maximum buffer size of the segment
should be less than or equal to MCLBYTES. This change also make it
possible to add TSO with minor changes.

Revision 1.233: download - view: text, markup, annotated - select for diffs
Wed Nov 4 20:40:38 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +11 -14 lines
SVN rev 198924 on 2009-11-04 20:40:38Z by yongari

Covert bge_newbuf_std to use bus_dmamap_load_mbuf_sg(9). Note,
bge_newbuf_std still has a bug for handling dma map load failure
under high network load. Just reusing mbuf is not enough as driver
already unloaded the dma map of the mbuf. Graceful recovery needs
more work.
Ideally we can just update dma address part of a Rx descriptor
because the controller never overwrite the Rx descriptor. This
requires some Rx initialization code changes and it would be done
later after fixing other incorrect bus_dma(9) usages.

Revision 1.232: download - view: text, markup, annotated - select for diffs
Wed Nov 4 20:19:21 2009 UTC (2 years, 3 months ago) by yongari
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +1 -1 lines
SVN rev 198923 on 2009-11-04 20:19:21Z by yongari

Use correct dma tag for jumbo buffer.

Revision 1.226.2.3.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.226.2.3: preferred, colored; next MAIN 1.226.2.4: preferred, colored
Changes since revision 1.226.2.3: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.231: download - view: text, markup, annotated - select for diffs
Wed Oct 21 11:50:18 2009 UTC (2 years, 3 months ago) by stas
Branches: MAIN
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +7 -4 lines
SVN rev 198318 on 2009-10-21 11:50:18Z by stas

- On entrance to the rx_eof sync RX rings maps with POSTWRITE flag
  instead of POSTREAD: the hardware do not touch this memory (CPU
  updates it).  It is already synchronized as PREWRITE after the
  processing is done.

- Synchronize RX return ring memory in rx_eof.  This is needed
  as the deviced updates this memory when receives packets.

- Decouple the synchronization of BGE status block in the interrupt
  service routine: perfrom PREREAD synchronization only all accesses
  to this block are finished.  This seems to be more natural.

Reviewed by:	yongari, marius
MFC after:	2 weeks

Revision 1.226.2.3: download - view: text, markup, annotated - select for diffs
Tue Oct 20 16:41:23 2009 UTC (2 years, 3 months ago) by stas
Branches: RELENG_8
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.226.2.2: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.2: +1 -1 lines
SVN rev 198296 on 2009-10-20 16:41:23Z by stas

- Disable ASF by default in STABLE_8.  This causes a lot
  of problems on non-DELL branded machines with IPMI
  support.  The proposed fix was committed to HEAD but has
  not received much test coverage yet.

Discussed with:	bz
Approved by:	re (kensmith)

Revision 1.230: download - view: text, markup, annotated - select for diffs
Tue Oct 13 20:22:12 2009 UTC (2 years, 3 months ago) by bz
Branches: MAIN
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +10 -10 lines
SVN rev 198049 on 2009-10-13 20:22:12Z by bz

Immediately after clearing a pending callout that didn't make it due
to the lock we hold, disable interrupts, and announce to the firmware
that we are shutting down. Especially do this before disabling blocks.

This makes some types of machines with asf enabled no longer hang upon
boot, when we start configuring the interface.

PR:			i386/96382, kern/100410, kern/122252, kern/116328
Reported by:		erwin
Hardware provided by:	TDC A/S
Reviewed by:		stas
Tested by:		stas

Revision 1.229: download - view: text, markup, annotated - select for diffs
Wed Oct 7 14:29:48 2009 UTC (2 years, 4 months ago) by stas
Branches: MAIN
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +1 -1 lines
SVN rev 197837 on 2009-10-07 14:29:48Z by stas

- Give a name to the host coalescing bug fix WDMA mode register bit instead
  of using hardcoded value in the code.
Obtained from:	OpenBSD

Revision 1.228: download - view: text, markup, annotated - select for diffs
Wed Oct 7 13:12:43 2009 UTC (2 years, 4 months ago) by stas
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +67 -13 lines
SVN rev 197832 on 2009-10-07 13:12:43Z by stas

- Add support for new BGE chips (5761, 5784 and 57780).  These chips uses new
  BGE_PCI_PRODID_ASICREV register to store the chip identifier and its revision.
- Add new grouping macro for 7575+ chips (BGE_IS_5755_PLUS).
- Add IDs for Fujitsu-branded Broadcom adapters.

PR:             kern/127587
Tested by:      Thomas Quinot <thomas@quinot.org> (BCM7561 A0)
MFC after:	2 weeks
Obtained from:  OpenBSD

Revision 1.226.2.2: download - view: text, markup, annotated - select for diffs
Tue Aug 18 21:13:00 2009 UTC (2 years, 5 months ago) by stas
Branches: RELENG_8
Diff to: previous 1.226.2.1: preferred, colored; branchpoint 1.226: preferred, colored
Changes since revision 1.226.2.1: +8 -7 lines
SVN rev 196371 on 2009-08-18 21:13:00Z by stas

- MFC r196370.
  Do not try to reevaluate current RX production index on each
  loop iteration as it can be updated by the card while we
  process the RX ring forcing us to process RX descriptors
  for which DMA synchronisation operation has not been
  performed.  This fixes the bug when bge(4) drops packets
  under high load.

Discussed with:	yongari, marius
Approved by:	re (kib)

Revision 1.227: download - view: text, markup, annotated - select for diffs
Tue Aug 18 21:07:39 2009 UTC (2 years, 5 months ago) by stas
Branches: MAIN
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +8 -7 lines
SVN rev 196370 on 2009-08-18 21:07:39Z by stas

- Do not try to reevaluate current RX production index on each
  loop iteration as it can be updated by the card while we
  process the RX ring forcing us to process RX descriptors
  for which DMA synchronisation operation has not been
  performed.  This fixes the bug when bge(4) drops packets
  under high load.

Discussed with:	yongari, marius
Approved by:	re (kib)
MFC after:	1 week

Revision 1.226.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.226: download - view: text, markup, annotated - select for diffs
Fri Jun 26 11:45:06 2009 UTC (2 years, 7 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +2 -2 lines
SVN rev 195049 on 2009-06-26 11:45:06Z by rwatson

Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/
IF_ADDR_UNLOCK() across network device drivers when accessing the
per-interface multicast address list, if_multiaddrs.  This will
allow us to change the locking strategy without affecting our driver
programming interface or binary interface.

For two wireless drivers, remove unnecessary locking, since they
don't actually access the multicast address list.

Approved by:	re (kib)
MFC after:	6 weeks

Revision 1.225: download - view: text, markup, annotated - select for diffs
Sat May 30 17:56:19 2009 UTC (2 years, 8 months ago) by attilio
Branches: MAIN
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +2 -2 lines
SVN rev 193103 on 2009-05-30 17:56:19Z by attilio

Fix return values appropriately.

Tested by:	zec

Revision 1.224: download - view: text, markup, annotated - select for diffs
Sat May 30 17:25:14 2009 UTC (2 years, 8 months ago) by attilio
Branches: MAIN
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +1 -1 lines
SVN rev 193100 on 2009-05-30 17:25:14Z by attilio

s/rk_npkts/rx_npkts

Reported by:	zec

Revision 1.223: download - view: text, markup, annotated - select for diffs
Sat May 30 15:14:44 2009 UTC (2 years, 8 months ago) by attilio
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +13 -9 lines
SVN rev 193096 on 2009-05-30 15:14:44Z by attilio

When user_frac in the polling subsystem is low it is going to busy the
CPU for too long period than necessary.  Additively, interfaces are kept
polled (in the tick) even if no more packets are available.
In order to avoid such situations a new generic mechanism can be
implemented in proactive way, keeping track of the time spent on any
packet and fragmenting the time for any tick, stopping the processing
as soon as possible.

In order to implement such mechanism, the polling handler needs to
change, returning the number of packets processed.
While the intended logic is not part of this patch, the polling KPI is
broken by this commit, adding an int return value and the new flag
IFCAP_POLLING_NOCOUNT (which will signal that the return value is
meaningless for the installed handler and checking should be skipped).

Bump __FreeBSD_version in order to signal such situation.

Reviewed by:	emaste
Sponsored by:	Sandvine Incorporated

Revision 1.198.2.18: download - view: text, markup, annotated - select for diffs
Wed May 20 21:17:10 2009 UTC (2 years, 8 months ago) by delphij
Branches: RELENG_7
Diff to: previous 1.198.2.17: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.17: +9 -0 lines
SVN rev 192478 on 2009-05-20 21:17:10Z by delphij

MFC r192127:

Try to workaround a race where bge_stop() may sneak in when bge_rxeof()
drops and re-grabs the softc mutex in the middle, resulting in kernel
trap 12.  This may happen when a lot of traffic is being hammered on
one bge(4) interface while the system is shutting down.

Reported by:	Alexander Sack <pisymbol gmail com>
PR:		kern/134548

Revision 1.222: download - view: text, markup, annotated - select for diffs
Thu May 14 22:36:56 2009 UTC (2 years, 8 months ago) by delphij
Branches: MAIN
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +3 -3 lines
SVN rev 192128 on 2009-05-14 22:36:56Z by delphij

Some comment/space changes (FALLTHRU -> FALLTHROUGH, space after while).

Revision 1.221: download - view: text, markup, annotated - select for diffs
Thu May 14 22:33:37 2009 UTC (2 years, 8 months ago) by delphij
Branches: MAIN
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +9 -0 lines
SVN rev 192127 on 2009-05-14 22:33:37Z by delphij

Try to workaround a race where bge_stop() may sneak in when bge_rxeof()
drops and re-grabs the softc mutex in the middle, resulting in kernel
trap 12.  This may happen when a lot of traffic is being hammered on
one bge(4) interface while the system is shutting down.

Reported by:	Alexander Sack <pisymbol gmail com>
PR:		kern/134548
MFC After:	2 weeks

Revision 1.198.2.17.2.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.198.2.17: preferred, colored; next MAIN 1.198.2.18: preferred, colored
Changes since revision 1.198.2.17: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.91.2.38: download - view: text, markup, annotated - select for diffs
Fri Mar 27 21:21:35 2009 UTC (2 years, 10 months ago) by marius
Branches: RELENG_6
Diff to: previous 1.91.2.37: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.37: +5 -4 lines
SVN rev 190479 on 2009-03-27 21:21:35Z by marius

MFC: r190319

- Ensure that INTx isn't disabled, as these chips apparently have a
  quirk requiring it to be enabled even when using MSI.
- Remove a comment which no longer applies since r190336.

Revision 1.198.2.17: download - view: text, markup, annotated - select for diffs
Fri Mar 27 21:21:22 2009 UTC (2 years, 10 months ago) by marius
Branches: RELENG_7
CVS tags: RELENG_7_2_BP
Branch point for: RELENG_7_2
Diff to: previous 1.198.2.16: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.16: +5 -4 lines
SVN rev 190478 on 2009-03-27 21:21:22Z by marius

MFC: r190319

- Ensure that INTx isn't disabled, as these chips apparently have a
  quirk requiring it to be enabled even when using MSI. This makes
  the latter work again after r189568.
- Remove a comment which no longer applies since r190335.

Approved by:	re (kib)

Revision 1.91.2.37: download - view: text, markup, annotated - select for diffs
Mon Mar 23 20:53:50 2009 UTC (2 years, 10 months ago) by marius
Branches: RELENG_6
Diff to: previous 1.91.2.36: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.36: +52 -24 lines
SVN rev 190336 on 2009-03-23 20:53:50Z by marius

MFC: r190194

- In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
- If boot verbose, print asicrev, chiprev and bus type on attach.
- For PCI Express devices:
  1) Adjust max read request size to 4Kbytes
  2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
  Though 1) does not seem to have much to do with the poor TX performance
  observed on PCI Express bge(4), 2) does fix the problem. [1]
- Nuke the RX CPU self-diag, which prevents working cards from working
  (Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
  The increasing of the firmware handshaking timeout to 20000 retries
  done as part of the original commit isn't merged as way already have a
  way higher BGE_TIMEOUT of 100000.

PR:		119361 [1]
Obtained from:	tg3 via DragonflyBSD [1], DragonflyBSD

Revision 1.198.2.16: download - view: text, markup, annotated - select for diffs
Mon Mar 23 20:53:38 2009 UTC (2 years, 10 months ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.15: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.15: +52 -23 lines
SVN rev 190335 on 2009-03-23 20:53:38Z by marius

MFC: r190194

- In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
- If boot verbose, print asicrev, chiprev and bus type on attach.
- For PCI Express devices:
  1) Adjust max read request size to 4Kbytes
  2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
  Though 1) does not seem to have much to do with the poor TX performance
  observed on PCI Express bge(4), 2) does fix the problem. [1]
- Nuke the RX CPU self-diag, which prevents working cards from working
  (Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
  The increasing of the firmware handshaking timeout to 20000 retries
  done as part of the original commit isn't merged as way already have a
  way higher BGE_TIMEOUT of 100000.

PR:		119361 [1]
Obtained from:	tg3 via DragonflyBSD [1], DragonflyBSD

Revision 1.220: download - view: text, markup, annotated - select for diffs
Mon Mar 23 14:36:50 2009 UTC (2 years, 10 months ago) by marius
Branches: MAIN
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +5 -4 lines
SVN rev 190319 on 2009-03-23 14:36:50Z by marius

- Ensure that INTx isn't disabled, as these chips apparently have a
  quirk requiring it to be enabled even when using MSI. This makes
  the latter work again after r189285.
- Remove a comment which no longer applies since r190194.

Revision 1.219: download - view: text, markup, annotated - select for diffs
Sat Mar 21 00:23:07 2009 UTC (2 years, 10 months ago) by marius
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +52 -23 lines
SVN rev 190194 on 2009-03-21 00:23:07Z by marius

- In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
- If boot verbose, print asicrev, chiprev and bus type on attach.
- For PCI Express devices:
  1) Adjust max read request size to 4Kbytes
  2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
  Though 1) does not seem to have much to do with the poor TX performance
  observed on PCI Express bge(4), 2) does fix the problem. [1]
- Nuke the RX CPU self-diag, which prevents working cards from working
  (Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
  The increasing of the firmware handshaking timeout to 20000 retries
  done as part of the original commit isn't merged as way already have a
  way higher BGE_TIMEOUT of 100000.

PR:		119361 [1]
Obtained from:	tg3 via DragonflyBSD [1], DragonflyBSD

Revision 1.198.2.15: download - view: text, markup, annotated - select for diffs
Thu Mar 19 16:44:37 2009 UTC (2 years, 10 months ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.14: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.14: +5 -4 lines
SVN rev 190082 on 2009-03-19 16:44:37Z by marius

MFC: r188164, r188457

- device_shutdown returns an int.
- Don't reset the PHY probe retry counter within the loop so
  it will eventually terminate as intended. [1]

Submitted by:	Helen Zhang [1]

Revision 1.91.2.36: download - view: text, markup, annotated - select for diffs
Thu Mar 19 16:44:37 2009 UTC (2 years, 10 months ago) by marius
Branches: RELENG_6
Diff to: previous 1.91.2.35: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.35: +5 -4 lines
SVN rev 190083 on 2009-03-19 16:44:37Z by marius

MFC: r188164, r188457

- device_shutdown returns an int.
- Don't reset the PHY probe retry counter within the loop so
  it will eventually terminate as intended. [1]

Submitted by:	Helen Zhang [1]

Revision 1.218: download - view: text, markup, annotated - select for diffs
Tue Feb 10 21:54:23 2009 UTC (2 years, 11 months ago) by marius
Branches: MAIN
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +1 -1 lines
SVN rev 188457 on 2009-02-10 21:54:23Z by marius

Don't reset the PHY probe retry counter within the loop so
it will eventually terminate as intended.

Submitted by:	Helen Zhang

Revision 1.217: download - view: text, markup, annotated - select for diffs
Thu Feb 5 18:43:13 2009 UTC (3 years ago) by imp
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +4 -3 lines
SVN rev 188164 on 2009-02-05 18:43:13Z by imp

device_shutdown returns an int.

Revision 1.91.2.35: download - view: text, markup, annotated - select for diffs
Thu Jan 15 20:23:44 2009 UTC (3 years ago) by marius
Branches: RELENG_6
Diff to: previous 1.91.2.34: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.34: +6 -6 lines
SVN rev 187310 on 2009-01-15 20:23:44Z by marius

MFC: r184380

Do as the Linux tg3 driver does and enable MSI support also
for the BCM5714 revision A0 when in a multi-port configuration
and unconditionally for the remainder of the class of BCM575X
and beyond chips.

Revision 1.198.2.14: download - view: text, markup, annotated - select for diffs
Thu Jan 15 20:23:38 2009 UTC (3 years ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.13: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.13: +6 -6 lines
SVN rev 187309 on 2009-01-15 20:23:38Z by marius

MFC: r184380

Do as the Linux tg3 driver does and enable MSI support also
for the BCM5714 revision A0 when in a multi-port configuration
and unconditionally for the remainder of the class of BCM575X
and beyond chips.

Revision 1.198.2.13: download - view: text, markup, annotated - select for diffs
Thu Jan 15 20:19:53 2009 UTC (3 years ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.12: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.12: +0 -4 lines
SVN rev 187308 on 2009-01-15 20:19:53Z by marius

MFC: r183896

Use bus_{read,write}_4(9) instead of bus_space_{read,write}_4(9)
in order to get rid of the bus space handle and tag in the softc.

Revision 1.91.2.34: download - view: text, markup, annotated - select for diffs
Thu Jan 15 20:13:50 2009 UTC (3 years ago) by marius
Branches: RELENG_6
Diff to: previous 1.91.2.33: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.33: +4 -3 lines
SVN rev 187307 on 2009-01-15 20:13:50Z by marius

MFC: r183281

- Don't read the identifier string from the VPD if there's no chip
  containing an Ethernet address fitted as this is yet another thing
  that fails in that case in order to avoid the one second delay
  until pci_read_vpd_reg() times out.
- Const'ify the bge_devs array.

Revision 1.198.2.12: download - view: text, markup, annotated - select for diffs
Thu Jan 15 20:13:22 2009 UTC (3 years ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.11: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.11: +4 -3 lines
SVN rev 187306 on 2009-01-15 20:13:22Z by marius

MFC: r183281

- Don't read the identifier string from the VPD if there's no chip
  containing an Ethernet address fitted as this is yet another thing
  that fails in that case in order to avoid the one second delay
  until pci_read_vpd_reg() times out.
- Const'ify the bge_devs array.

Revision 1.91.2.33: download - view: text, markup, annotated - select for diffs
Mon Dec 15 20:40:06 2008 UTC (3 years, 1 month ago) by marius
Branches: RELENG_6
Diff to: previous 1.91.2.32: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.32: +12 -7 lines
SVN rev 186136 on 2008-12-15 20:40:06Z by marius

- Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which
  causes data corruption in combination with certain bridges.
  Information about this problem was kindly provided by davidch. [1]
- As BGE_FLAG_PCIX is meant to indicate that the controller is in
  PCI-X mode, revert to the pre __FreeBSD_version 602101 method of
  reading the bus mode register rather than checking the mere
  existence of a PCI-X capability, which is also there when the
  NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X
  mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC
  to be tuned incorrectly.

PR:		128833 [1]
Reviewed by:	jhb

Revision 1.198.2.10.2.2: download - view: text, markup, annotated - select for diffs
Mon Dec 15 20:36:32 2008 UTC (3 years, 1 month ago) by marius
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.198.2.10.2.1: preferred, colored; branchpoint 1.198.2.10: preferred, colored; next MAIN 1.198.2.11: preferred, colored
Changes since revision 1.198.2.10.2.1: +12 -7 lines
SVN rev 186135 on 2008-12-15 20:36:32Z by marius

- Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which
  causes data corruption in combination with certain bridges.
  Information about this problem was kindly provided by davidch. [1]
- As BGE_FLAG_PCIX is meant to indicate that the controller is in
  PCI-X mode, revert to the pre __FreeBSD_version 602101 method of
  reading the bus mode register rather than checking the mere
  existence of a PCI-X capability, which is also there when the
  NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X
  mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC
  to be tuned incorrectly.

PR:		128833 [1]
Reviewed by:	jhb
Approved by:	re (kib)

Revision 1.198.2.11: download - view: text, markup, annotated - select for diffs
Mon Dec 15 20:32:16 2008 UTC (3 years, 1 month ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.10: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.10: +12 -7 lines
SVN rev 186134 on 2008-12-15 20:32:16Z by marius

- Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which
  causes data corruption in combination with certain bridges.
  Information about this problem was kindly provided by davidch. [1]
- As BGE_FLAG_PCIX is meant to indicate that the controller is in
  PCI-X mode, revert to the pre __FreeBSD_version 602101 method of
  reading the bus mode register rather than checking the mere
  existence of a PCI-X capability, which is also there when the
  NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X
  mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC
  to be tuned incorrectly.

PR:		128833 [1]
Reviewed by:	jhb
Approved by:	re (kib)

Revision 1.216: download - view: text, markup, annotated - select for diffs
Tue Dec 9 21:34:22 2008 UTC (3 years, 2 months ago) by marius
Branches: MAIN
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +12 -7 lines
SVN rev 185812 on 2008-12-09 21:34:22Z by marius

- Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which
  causes data corruption in combination with certain bridges.
  Information about this problem was kindly provided by davidch. [1]
- As BGE_FLAG_PCIX is meant to indicate that the controller is in
  PCI-X mode, revert to the pre __FreeBSD_version 602101 method of
  reading the bus mode register rather than checking the mere
  existence of a PCI-X capability, which is also there when the
  NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X
  mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC
  to be tuned incorrectly.

PR:		128833 [1]
Reviewed by:	jhb
MFC after:	3 days

Revision 1.198.2.10.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
Diff to: previous 1.198.2.10: preferred, colored
Changes since revision 1.198.2.10: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.215: download - view: text, markup, annotated - select for diffs
Mon Oct 27 22:10:01 2008 UTC (3 years, 3 months ago) by marius
Branches: MAIN
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +6 -6 lines
SVN rev 184380 on 2008-10-27 22:10:01Z by marius

Do as the Linux tg3 driver does and enable MSI support also
for the BCM5714 revision A0 when in a multi-port configuration
and unconditionally for the remainder of the class of BCM575X
and beyond chips.
This was prodded by mav and is based on a suggestion and a
patch submitted by jhb.

Reviewed by:	jhb
MFC after:	2 months

Revision 1.214: download - view: text, markup, annotated - select for diffs
Tue Oct 14 20:28:42 2008 UTC (3 years, 3 months ago) by marius
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +0 -4 lines
SVN rev 183896 on 2008-10-14 20:28:42Z by marius

Use bus_{read,write}_4(9) instead of bus_space_{read,write}_4(9)
in order to get rid of the bus space handle and tag in the softc.

MFC after:	1 month

Revision 1.91.2.32.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.91.2.32: preferred, colored; next MAIN 1.91.2.33: preferred, colored
Changes since revision 1.91.2.32: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.213: download - view: text, markup, annotated - select for diffs
Mon Sep 22 20:55:19 2008 UTC (3 years, 4 months ago) by marius
Branches: MAIN
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +4 -3 lines
SVN rev 183281 on 2008-09-22 20:55:19Z by marius

- Don't read the identifier string from the VPD if there's no chip
  containing an Ethernet address fitted as this is yet another thing
  that fails in that case in order to avoid the one second delay
  until pci_read_vpd_reg() times out.
- Const'ify the bge_devs array.

Revision 1.91.2.32: download - view: text, markup, annotated - select for diffs
Thu Sep 18 22:29:05 2008 UTC (3 years, 4 months ago) by oleg
Branches: RELENG_6
CVS tags: RELENG_6_4_BP
Branch point for: RELENG_6_4
Diff to: previous 1.91.2.31: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.31: +6 -2 lines
SVN rev 183162 on 2008-09-18 22:29:05Z by oleg

MFC: 182874
bge_tick(): do not touch PHY if link is up. This should solve problem with
extra input errors for some BCM57XX chips.

PR:		kern/122295
Approved by:	re (kensmith)

Revision 1.198.2.10: download - view: text, markup, annotated - select for diffs
Thu Sep 18 22:24:49 2008 UTC (3 years, 4 months ago) by oleg
Branches: RELENG_7
CVS tags: RELENG_7_1_BP
Branch point for: RELENG_7_1
Diff to: previous 1.198.2.9: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.9: +6 -2 lines
SVN rev 183161 on 2008-09-18 22:24:49Z by oleg

MFC: 182874
bge_tick(): do not touch PHY if link is up. This should solve problem with
extra input errors for some BCM57XX chips.

PR:		kern/122295
Approved by:	re (kensmith)

Revision 1.212: download - view: text, markup, annotated - select for diffs
Mon Sep 8 18:10:15 2008 UTC (3 years, 5 months ago) by oleg
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +6 -2 lines
SVN rev 182874 on 2008-09-08 18:10:15Z by oleg

bge_tick(): do not touch PHY if link is up. This should solve problem with
extra input errors for some BCM57XX chips.

PR:		kern/122295

Revision 1.91.2.31: download - view: text, markup, annotated - select for diffs
Fri Jun 27 03:35:48 2008 UTC (3 years, 7 months ago) by jhb
Branches: RELENG_6
Diff to: previous 1.91.2.30: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.30: +302 -95 lines
SVN rev 180055 on 2008-06-27 03:35:48Z by jhb

MFC: Add support for the BCM5906[M] adapters including subsequent
improvements by marius@.

Revision 1.91.2.30: download - view: text, markup, annotated - select for diffs
Fri Jun 27 03:31:05 2008 UTC (3 years, 7 months ago) by jhb
Branches: RELENG_6
Diff to: previous 1.91.2.29: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.29: +12 -9 lines
SVN rev 180054 on 2008-06-27 03:31:05Z by jhb

MFC: Fix time out check in EEPROM read and move delays to give some settle
time.

Revision 1.198.2.9: download - view: text, markup, annotated - select for diffs
Fri Jun 27 03:24:54 2008 UTC (3 years, 7 months ago) by jhb
Branches: RELENG_7
Diff to: previous 1.198.2.8: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.8: +302 -95 lines
SVN rev 180053 on 2008-06-27 03:24:54Z by jhb

MFC: Add support for the BCM5906[M] adapters including subsequent
improvements by marius@.

Revision 1.91.2.29: download - view: text, markup, annotated - select for diffs
Fri Jun 27 03:19:03 2008 UTC (3 years, 7 months ago) by jhb
Branches: RELENG_6
Diff to: previous 1.91.2.28: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.28: +9 -0 lines
SVN rev 180052 on 2008-06-27 03:19:03Z by jhb

MFC: Add a flag for Ethernet@WireSpeed capability and correct chip
revisions.

Revision 1.91.2.28: download - view: text, markup, annotated - select for diffs
Fri Jun 27 03:11:34 2008 UTC (3 years, 7 months ago) by jhb
Branches: RELENG_6
Diff to: previous 1.91.2.27: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.27: +92 -34 lines
SVN rev 180051 on 2008-06-27 03:11:34Z by jhb

MFC:
- Add support/quirks for the on-board BGEs found in various Sun machines.
- In bge_attach() factor out calling bge_release_resources() before
  going to the fail label.

Revision 1.198.2.8: download - view: text, markup, annotated - select for diffs
Fri Jun 27 03:02:50 2008 UTC (3 years, 7 months ago) by jhb
Branches: RELENG_7
Diff to: previous 1.198.2.7: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.7: +9 -0 lines
SVN rev 180050 on 2008-06-27 03:02:50Z by jhb

MFC: Add a flag for Ethernet@WireSpeed capability and correct chip
revisions.

Revision 1.198.2.7: download - view: text, markup, annotated - select for diffs
Sat May 24 10:23:35 2008 UTC (3 years, 8 months ago) by bz
Branches: RELENG_7
Diff to: previous 1.198.2.6: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.6: +34 -2 lines
MFC: if_bgereg.h rev. 1.79
     if_bge.c rev. 1.205, 1.209, 1.210

  Summary:
  In some situations we were not clearing pending link state attentions.
  Because of this we were not getting further interrupts for link state
  changes, thus never went into iface UP state and thus could not transmit.

  The only way out of this was an incoming packet generating an rx interrupt
  and making us call into bge_link_upd.

  What we do now is force an interrupt at the end of bge_ifmedia_upd_locked
  so we will call bge_link_upd, clear the link state attention and get
  further interrupts.

  While the initial version was not expected to work with all chips
  the later update in rev. 1.210 is.

PR:                             kern/111804
Tested by:                      phk, scottl (initial version)
Thanks for your help to:        davidch, Broadcom

Revision 1.198.2.6: download - view: text, markup, annotated - select for diffs
Thu May 15 20:12:17 2008 UTC (3 years, 8 months ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.5: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.5: +0 -0 lines
Forced commit to denote that revision 1.198.2.5 actually was
an MFC of 1.206.

Revision 1.91.2.27: download - view: text, markup, annotated - select for diffs
Wed May 14 21:22:17 2008 UTC (3 years, 8 months ago) by marius
Branches: RELENG_6
Diff to: previous 1.91.2.26: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.26: +5 -11 lines
MFC: 1.206 (partial)

Use more appropriate maxsize, nsegments and maxsegsize parameters
when creating the parent bus DMA tag. While at it correct the style
and a nearby comment.

Revision 1.198.2.5: download - view: text, markup, annotated - select for diffs
Wed May 14 21:07:25 2008 UTC (3 years, 8 months ago) by marius
Branches: RELENG_7
Diff to: previous 1.198.2.4: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.4: +6 -12 lines
MFC: 1.208

- Use more appropriate maxsize, nsegments and maxsegsize parameters
  when creating the parent bus DMA tag. While at it correct the style
  and a nearby comment.
- Take advantage of m_collapse(9) for performance reasons.

Revision 1.211: download - view: text, markup, annotated - select for diffs
Wed May 14 21:00:27 2008 UTC (3 years, 8 months ago) by marius
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +62 -64 lines
Improve the integration of BCM5906[M] support:
- Rename BGE_FLAG_EEPROM to BGE_FLAG_EADDR to underline it's absence means
  "there's no chip containing an Ethernet address fitted to the BGE chip
  so we have to get it from the firmware instead" rather than "there's no
  EEPROM, but maybe NVRAM or something else".
- Don't treat BCM5906[M] generally like chips w/o BGE_FLAG_EADDR set, just
  in the two cases really necessary. This gets us line with the original
  patch for DragonFlyBSD.
- For sparc64 restore the intended behavior of obtaining the Ethernet
  address from the firmware in case BGE_FLAG_EADDR is not set, even for
  BCM5906[M].
- Fix some style(9) bugs introduced with rev. 1.208 of if_bge.c

Approved by:		jhb
Additional testing by:	Thomas Nystroem (BCM5906)

Revision 1.210: download - view: text, markup, annotated - select for diffs
Mon May 5 18:42:17 2008 UTC (3 years, 9 months ago) by bz
Branches: MAIN
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +21 -6 lines
Use a better approach to force the interrupt which should work for
all cards/modes.
In addition to the intr forcing added with rev. 1.205 adopt the other
places to use the same logic.

We need to exclude a few chips/revisions (5700, 5788) from using the
enhanced version and fall back to the old way as that is the only
method they support.

Tested by:	phk
Suggested by:	davidch, Broadcom (thanks a lot for the help!)
MFC after:	16 days

Revision 1.209: download - view: text, markup, annotated - select for diffs
Thu May 1 13:10:03 2008 UTC (3 years, 9 months ago) by bz
Branches: MAIN
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +1 -1 lines
Use the correct bit when trying to force an interrupt through the HCC reg.
It's not a problem as this is a #ifdef notyet.

Revision 1.208: download - view: text, markup, annotated - select for diffs
Tue Apr 29 19:47:12 2008 UTC (3 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +268 -59 lines
Add support for the BCM5906[M] adapters.  These adapters only support
10/100 operation and place the mailbox registers at a different offset.
They also do not have an EEPROM, so the MAC address must be read from
NVRAM instead.

MFC after:	1 month
PR:		kern/118975
Submitted by:	benjsc, Thomas Nyström  thn at saeab dot se
Submitted by:	sephe (original patch for DragonflyBSD)

Revision 1.207: download - view: text, markup, annotated - select for diffs
Sat Apr 26 14:13:48 2008 UTC (3 years, 9 months ago) by marius
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +1 -1 lines
Remove some remnant alpha hacks.

Approved by:	PCI-maintainers (imp, jhb)

Revision 1.206: download - view: text, markup, annotated - select for diffs
Sat Apr 26 10:54:17 2008 UTC (3 years, 9 months ago) by marius
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +6 -12 lines
- Use more appropriate maxsize, nsegments and maxsegsize parameters
  when creating the parent bus DMA tag. While at it correct the style
  and a nearby comment.
- Take advantage of m_collapse(9) for performance reasons.

MFC after:	2 weeks

Revision 1.205: download - view: text, markup, annotated - select for diffs
Tue Apr 8 11:51:17 2008 UTC (3 years, 10 months ago) by bz
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +17 -0 lines
In some situations we were not clearing pending link state attentions.
Because of this we were not getting further interrupts for link state
changes, thus never went into iface UP state and thus could not transmit.

The only way out of this was an incoming packet generating an rx interrupt
and making us call into bge_link_upd.

Up to rev. 1.101, in bge_start_locked, we only returned instantly
if there was 'no link AND nothing queued for tx'. So with a packet queued
for tx, we hit the register scrubbing at the end of bge_start_locked
and were out fine. We simply lost a packet or two but got the interrupts
need to get into UP state.
With rev. 1.102 this was turned into 'if there is no link OR there is
nothing to send' (correct behaviour) and as long as there is no link
we never hit the register scrubbing and consequently never got the link UP.

What we do now is force an interrupt at the end of bge_ifmedia_upd_locked
so we will call bge_link_upd, clear the link state attention and get
further interrupts.
This helps to get the iface UP on an idle network or at least to get
it UP faster not depending on an rx intr anymore.
In case you could not get a DHCP lease or it took very long,
it was because of this.

It is unknown which chips are affected by this. ASIC rev. 0x2003 was the
most popular trouble candidate.
At least the fiber cards should have been working fine.

Which register to scrub is currently under discussion. The comitted
solution was tested and found to work for a lot of setups. It might
not help with MSI.
The reason why we end up in such a situation is entirely unknown.

PR:		kern/111804
Tested by:	phk, scottl at Y!
MFC after:	14 days

Revision 1.91.2.26: download - view: text, markup, annotated - select for diffs
Mon Mar 17 18:24:04 2008 UTC (3 years, 10 months ago) by jhb
Branches: RELENG_6
Diff to: previous 1.91.2.25: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.25: +6 -3 lines
MFC: Add support for the BCM5722.

Revision 1.198.2.4: download - view: text, markup, annotated - select for diffs
Mon Mar 17 18:23:44 2008 UTC (3 years, 10 months ago) by jhb
Branches: RELENG_7
Diff to: previous 1.198.2.3: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.3: +6 -3 lines
MFC: Add support for the BCM5722.

Revision 1.204: download - view: text, markup, annotated - select for diffs
Tue Mar 11 15:05:54 2008 UTC (3 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +4 -3 lines
Don't enable the workaround for the jitter bug on the 5722.

Obtained from:	Linux tg3 driver

Revision 1.203: download - view: text, markup, annotated - select for diffs
Thu Mar 6 21:42:48 2008 UTC (3 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +1 -0 lines
Flesh out support for the BCM5722 by recognizing the phy on the 5722 and
the specific ASIC revision.

MFC after:	1 week
Obtained from:	OpenBSD (mii/phy bits)

Revision 1.198.2.2.2.1: download - view: text, markup, annotated - select for diffs
Tue Jan 22 17:30:13 2008 UTC (4 years ago) by jkim
Branches: RELENG_7_0
CVS tags: RELENG_7_0_0_RELEASE
Diff to: previous 1.198.2.2: preferred, colored; next MAIN 1.198.2.3: preferred, colored
Changes since revision 1.198.2.2: +1 -1 lines
MFC:	1.201

Fix mbuf pool watermark configuration.

Approved by:	re (kensmith)

Revision 1.91.2.25: download - view: text, markup, annotated - select for diffs
Tue Jan 22 17:13:40 2008 UTC (4 years ago) by jkim
Branches: RELENG_6
Diff to: previous 1.91.2.24: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.24: +13 -15 lines
MFC:	1.194

Remove BCM5704S specific tunable (hw.bge.fake_autoneg) and
auto-detect the condition.

PR:	kern/118308

Revision 1.91.2.24: download - view: text, markup, annotated - select for diffs
Mon Jan 21 18:04:41 2008 UTC (4 years ago) by jkim
Branches: RELENG_6
Diff to: previous 1.91.2.23: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.23: +1 -1 lines
MFC:	1.201

Fix mbuf pool watermark configuration.

Revision 1.198.2.3: download - view: text, markup, annotated - select for diffs
Mon Jan 21 17:17:00 2008 UTC (4 years ago) by jkim
Branches: RELENG_7
Diff to: previous 1.198.2.2: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.2: +1 -1 lines
MFC:	1.201

Fix mbuf pool watermark configuration.

Revision 1.202: download - view: text, markup, annotated - select for diffs
Fri Jan 18 22:09:49 2008 UTC (4 years ago) by jkim
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +9 -0 lines
Add a flag for Ethernet@WireSpeed capability and correct chip revisions.
The idea was taken from OpenBSD and cross-referenced with Linux driver.

Revision 1.201: download - view: text, markup, annotated - select for diffs
Fri Jan 18 20:33:21 2008 UTC (4 years ago) by jkim
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +1 -1 lines
Fix mbuf pool watermark configuration (mismerged from OpenBSD in 1.132).

Submitted by:	sephe
MFC after:	3 days

Revision 1.200: download - view: text, markup, annotated - select for diffs
Tue Dec 25 19:51:18 2007 UTC (4 years, 1 month ago) by remko
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +1 -0 lines
Add support for the BMC5722.

Reported by:		Chris Shenton <chris at shenton dot org> on current@
Approved by:		imp (mentor)

Revision 1.198.2.2: download - view: text, markup, annotated - select for diffs
Mon Nov 26 17:33:28 2007 UTC (4 years, 2 months ago) by jkim
Branches: RELENG_7
CVS tags: RELENG_7_0_BP
Branch point for: RELENG_7_0
Diff to: previous 1.198.2.1: preferred, colored; branchpoint 1.198: preferred, colored
Changes since revision 1.198.2.1: +6 -7 lines
MFC:	1.199

Do not report MAC, TX, and RX stats via sysctl(8) with BCM5705+.
The register layout is little different from memory-mapped stats
in the previous generation chips.  In fact, it is bad because
registers in this range are cleared after reading them.

Approved by:	re (kensmith)

Revision 1.199: download - view: text, markup, annotated - select for diffs
Fri Nov 16 16:39:27 2007 UTC (4 years, 2 months ago) by jkim
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +6 -7 lines
Do not report MAC, TX, and RX stats via sysctl(8) with BCM5705+.
The register layout is little different from memory-mapped stats
in the previous generation chips.  In fact, it is bad because
registers in this range are cleared after reading them.

Reviewed by:	scottl
MFC after:	3 days

Revision 1.198.2.1: download - view: text, markup, annotated - select for diffs
Fri Oct 26 19:47:01 2007 UTC (4 years, 3 months ago) by jkim
Branches: RELENG_7
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +1 -1 lines
Disable hw.bge.allow_asf tunable by default on the release branch.
This is not to surprise 6.x users when they upgrade to 7.0.

Approved by:	re (kensmith)

Revision 1.198: download - view: text, markup, annotated - select for diffs
Sun Sep 30 11:05:14 2007 UTC (4 years, 4 months ago) by marius
Branches: MAIN
CVS tags: RELENG_7_BP
Branch point for: RELENG_7
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +3 -2 lines
Make the PCI code aware of PCI domains (aka PCI segments) so we can
support machines having multiple independently numbered PCI domains
and don't support reenumeration without ambiguity amongst the
devices as seen by the OS and represented by PCI location strings.
This includes introducing a function pci_find_dbsf(9) which works
like pci_find_bsf(9) but additionally takes a domain number argument
and limiting pci_find_bsf(9) to only search devices in domain 0 (the
only domain in single-domain systems). Bge(4) and ofw_pcibus(4) are
changed to use pci_find_dbsf(9) instead of pci_find_bsf(9) in order
to no longer report false positives when searching for siblings and
dupe devices in the same domain respectively.
Along with this change the sole host-PCI bridge driver converted to
actually make use of PCI domain support is uninorth(4), the others
continue to use domain 0 only for now and need to be converted as
appropriate later on.
Note that this means that the format of the location strings as used
by pciconf(8) has been changed and that consumers of <sys/pciio.h>
potentially need to be recompiled.

Suggested by:	jhb
Reviewed by:	grehan, jhb, marcel
Approved by:	re (kensmith), jhb (PCI maintainer hat)

Revision 1.197: download - view: text, markup, annotated - select for diffs
Mon Jun 4 18:25:03 2007 UTC (4 years, 8 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +1 -1 lines
Despite several examples in the kernel, the third argument of
sysctl_handle_int is not sizeof the int type you want to export.
The type must always be an int or an unsigned int.

Remove the instances where a sizeof(variable) is passed to stop
people accidently cut and pasting these examples.

In a few places this was sysctl_handle_int was being used on 64 bit
types, which would truncate the value to be exported.  In these
cases use sysctl_handle_quad to export them and change the format
to Q so that sysctl(1) can still print them.

Revision 1.196: download - view: text, markup, annotated - select for diffs
Fri Jun 1 02:02:39 2007 UTC (4 years, 8 months ago) by yar
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +41 -2 lines
Add on/off controls for VLAN_MTU and VLAN_HWTAGGING to bge(4).

Revision 1.195: download - view: text, markup, annotated - select for diffs
Tue May 22 20:24:07 2007 UTC (4 years, 8 months ago) by jkim
Branches: MAIN
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +0 -1 lines
Remove an empty line.

Revision 1.194: download - view: text, markup, annotated - select for diffs
Tue May 22 19:35:34 2007 UTC (4 years, 8 months ago) by jkim
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +13 -15 lines
Remove BCM5704S specific tunable (hw.bge.fake_autoneg) and
auto-detect the condition.

Revision 1.193: download - view: text, markup, annotated - select for diffs
Tue May 22 19:22:58 2007 UTC (4 years, 8 months ago) by jkim
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +43 -43 lines
Rearrange DMA read/write control register settings based on document snippet
provided by davidch via glebius.

PR:		kern/96806

Revision 1.192: download - view: text, markup, annotated - select for diffs
Tue May 22 19:11:39 2007 UTC (4 years, 8 months ago) by jkim
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +0 -11 lines
Remove stale alpha support code.

Revision 1.191: download - view: text, markup, annotated - select for diffs
Tue May 22 18:51:05 2007 UTC (4 years, 8 months ago) by jkim
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +12 -11 lines
Fix time out check in EEPROM read and move delays to give some settle time.

Submitted by:	mjacob

Revision 1.190: download - view: text, markup, annotated - select for diffs
Tue May 22 18:16:23 2007 UTC (4 years, 8 months ago) by jkim
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +2 -0 lines
Add delays in MI communication register R/W loops.

Revision 1.91.2.23: download - view: text, markup, annotated - select for diffs
Tue May 8 16:18:21 2007 UTC (4 years, 9 months ago) by jkim
Branches: RELENG_6
CVS tags: RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3
Diff to: previous 1.91.2.22: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.22: +1 -1 lines
MFC:	1.189

Reflect MFC of pci_find_extcap().

Revision 1.189: download - view: text, markup, annotated - select for diffs
Tue May 1 19:18:12 2007 UTC (4 years, 9 months ago) by jkim
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +1 -1 lines
Reflect MFC of pci_find_extcap().

MFC after:	3 days

Revision 1.188: download - view: text, markup, annotated - select for diffs
Mon Apr 30 21:55:27 2007 UTC (4 years, 9 months ago) by marius
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +92 -34 lines
- Add support/quirks for the on-board BGEs found in Sun Blade 1500
  Blade 2500, Fire V210 and probably some other sparc64 machines.
  These chips are typically not fitted with an EEPROM which means
  that we have to obtain the MAC address via OFW and that some chip
  tests will just always fail.
  These changes are based on the respective code found in OpenBSD
  with some additional info obtained from OpenSolaris and some style
  suggestions by jkim@. They also have the desired side-effect of
  respecting the 'local-mac-address?' system configuration variable
  for the affected BGEs.
- In bge_attach() factor out calling bge_release_resources() before
  going to the fail label into the fail label as well as replace a
  magic 6 with ETHER_ADDR_LEN.

Reviewed by:	yongari (before style changes), jkim

Revision 1.91.2.22: download - view: text, markup, annotated - select for diffs
Fri Apr 13 18:25:03 2007 UTC (4 years, 9 months ago) by jkim
Branches: RELENG_6
Diff to: previous 1.91.2.21: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.21: +3 -3 lines
MFC:	1.187

Enable MSI support on RELENG_6.

Revision 1.187: download - view: text, markup, annotated - select for diffs
Mon Apr 2 19:09:06 2007 UTC (4 years, 10 months ago) by jkim
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +3 -3 lines
Enable MSI support on RELENG_6.

MFC after:	3 days

Revision 1.91.2.21: download - view: text, markup, annotated - select for diffs
Wed Mar 21 22:53:22 2007 UTC (4 years, 10 months ago) by jkim
Branches: RELENG_6
Diff to: previous 1.91.2.20: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.20: +982 -397 lines
MFC: Sync bge(4) with -CURRENT (minus if_bge.c 1.185 and 1.186)

- Support for BCM5754/5755/5786/5787.
- Support for IPMI/ASF mode (disabled by default)
- Fix lots of bugs including style(9) nits.

Tested by:	net, stable

Revision 1.186: download - view: text, markup, annotated - select for diffs
Tue Mar 13 00:41:55 2007 UTC (4 years, 11 months ago) by scottl
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +11 -16 lines
Fix some OID names and minor style as per feedback from various people.
Also, apparently quad support is broken in the sysctl infrastructure, so don't
pretend that it works.

Submitted by: ru, bde

Revision 1.185: download - view: text, markup, annotated - select for diffs
Mon Mar 12 09:25:57 2007 UTC (4 years, 11 months ago) by scottl
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +147 -10 lines
Add MAC, RX, and TX stats reporting via sysctl.

Revision 1.184: download - view: text, markup, annotated - select for diffs
Fri Mar 9 01:30:23 2007 UTC (4 years, 11 months ago) by jkim
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +4 -0 lines
Add more chipset revision IDs.

Obtained from:	OpenBSD

Revision 1.183: download - view: text, markup, annotated - select for diffs
Thu Mar 8 00:49:26 2007 UTC (4 years, 11 months ago) by jkim
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +2 -2 lines
Use correct bits to stop firmware when ASF mode is enabled.

Revision 1.182: download - view: text, markup, annotated - select for diffs
Thu Mar 8 00:29:18 2007 UTC (4 years, 11 months ago) by jkim
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +62 -76 lines
Fix more style(9) bugs.

- Remove some excessive parentheses around shift operators.
- Use macro instead of magic number where it is applicable.
- Change lower-case hexdecimals to upper cases to match wpaul's style.
- Revert some unnecessary line wraps and changes from the previous commit.

Pointed out by:	bde

Revision 1.181: download - view: text, markup, annotated - select for diffs
Tue Mar 6 20:14:48 2007 UTC (4 years, 11 months ago) by jkim
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +105 -87 lines
Fix style(9) and consistency.

Revision 1.180: download - view: text, markup, annotated - select for diffs
Tue Mar 6 19:15:16 2007 UTC (4 years, 11 months ago) by jkim
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +77 -27 lines
Pollute bge(4) with #if's and #ifdef's to make MFC easier.

MFC after:	3 days

Revision 1.91.2.20: download - view: text, markup, annotated - select for diffs
Fri Mar 2 19:19:31 2007 UTC (4 years, 11 months ago) by jkim
Branches: RELENG_6
Diff to: previous 1.91.2.19: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.19: +1 -1 lines
MFC: Use ETHER_BPF_MTAP() instead of BPF_MTAP().

Revision 1.179: download - view: text, markup, annotated - select for diffs
Fri Feb 23 12:18:34 2007 UTC (4 years, 11 months ago) by piso
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +1 -1 lines
o break newbus api: add a new argument of type driver_filter_t to
  bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@

Revision 1.3.2.42: download - view: text, markup, annotated - select for diffs
Thu Feb 15 10:33:49 2007 UTC (4 years, 11 months ago) by bde
Branches: RELENG_4
Diff to: previous 1.3.2.41: preferred, colored; next MAIN 1.4: preferred, colored
Changes since revision 1.3.2.41: +8 -4 lines
MFC (if_bge.c 1.108, etc., less some style bugs: eliminate one PCI
read per call to bge_start()).

In packet blasting tests using ttcp with tiny udp packets on an A64-3200
with a 64-bit 5701 on a 32-bit 33MHz PCI bus, this gives a speedup
from 347 kpps to 623 kpps.  sendto() has a lot of software overheads,
but even with these the single PCI write per call to bge_start() almost
doubled the per-packet time.  This is partly because the software
overheads are so large that the CPU can't keep up with a Gbps NIC that
can actually get anywhere near Gbps speed for tiny packets (347 kppps
for tiny packets is only about 21% of wire speed).  When the CPU can't
keep up, it gets further behind because it ends up calling bge_start()
at least once for every packet, so any overheads in bge_start() are
not amortized across multiple packets.  Thus the PCI read had an
especially high overhead.

For larger packets, the speedup is closer to the 1.8% claimed in rev.
1.108.

Rev.1.108 claims to eliminate a PCI write but actually eliminates a
PCI read.  The write of the tx product index is not so costly as its
read, and cannot be eliminated completely.  It could be coalesced in
some cases.

Revision 1.178: download - view: text, markup, annotated - select for diffs
Wed Feb 14 19:44:15 2007 UTC (4 years, 11 months ago) by jkim
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +1 -1 lines
Use bge_writereg_ind() to do global reset as we did before 1.159 for certain
chipsets.  It was causing 'firmware handshake timed out' errors for some
chips.

Discussed with:	scottl

Revision 1.177: download - view: text, markup, annotated - select for diffs
Wed Feb 14 19:01:33 2007 UTC (4 years, 11 months ago) by jkim
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +2 -2 lines
Fix two typos in comments.

Revision 1.176: download - view: text, markup, annotated - select for diffs
Mon Feb 12 23:58:52 2007 UTC (4 years, 11 months ago) by jkim
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +3 -0 lines
Add BCM5701 A0/B0 CRC bug workaround.  Magic values taken from Linux driver.

Revision 1.175: download - view: text, markup, annotated - select for diffs
Mon Feb 12 23:33:04 2007 UTC (4 years, 11 months ago) by jkim
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +25 -25 lines
Fix style(9).

Pointed out by:	many

Revision 1.174: download - view: text, markup, annotated - select for diffs
Mon Feb 12 22:51:24 2007 UTC (4 years, 11 months ago) by jkim
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +4 -1 lines
Add PHY DSP code for BCM5755M.

Obtained from:	OpenBSD

Revision 1.173: download - view: text, markup, annotated - select for diffs
Mon Jan 15 21:43:43 2007 UTC (5 years ago) by jkim
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +18 -7 lines
- Fix BCM5754 support found in Dell PowerEdge SC440.
- Move some PHY bug detections from brgphy.c to if_bge.c.
- Do not penalize working PHYs.
- Re-arrange bge_flags roughly by their categories.
- Fix minor style(9) nits.

PR:		kern/107257
Obtained from:	OpenBSD
Tested by:	Mike Hibler <mike at flux dot utah dot edu>

Revision 1.172: download - view: text, markup, annotated - select for diffs
Tue Dec 26 18:33:55 2006 UTC (5 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +2 -8 lines
After rev.1.169, the "interrupt" coalescing parameters are not used in
bge_intr().  Some of them are used in bge_poll().  Simplify by only
initializing these for polling mode and not toggling them when switching
modes.  This also fixes missing synchronization with the coalescing
engine in the toggling.

Revision 1.171: download - view: text, markup, annotated - select for diffs
Fri Dec 22 02:59:58 2006 UTC (5 years, 1 month ago) by jdp
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +86 -34 lines
Re-enable MSI support for those chips on which it is believed to work
properly.

Revision 1.91.2.18.2.1: download - view: text, markup, annotated - select for diffs
Thu Dec 21 21:53:54 2006 UTC (5 years, 1 month ago) by scottl
Branches: RELENG_6_2
CVS tags: RELENG_6_2_0_RELEASE
Diff to: previous 1.91.2.18: preferred, colored; next MAIN 1.91.2.19: preferred, colored
Changes since revision 1.91.2.18: +2 -15 lines
Partially back out revs 1.134 and 1.50 of if_bge.c and if_bgereg.h,
respectively.  A lot more is needed to support these chips than just PCI
IDs, and the code added to 7-CURRENT isn't ready for FreeBSD 6 yet.

Approved by: re

Revision 1.91.2.19: download - view: text, markup, annotated - select for diffs
Thu Dec 21 21:51:44 2006 UTC (5 years, 1 month ago) by scottl
Branches: RELENG_6
Diff to: previous 1.91.2.18: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.18: +2 -15 lines
Partially back out revs 1.134 and 1.50 of if_bge.c and if_bgereg.h,
respectively.  A lot more is needed to support these chips than just PCI
IDs, and the code added to 7-CURRENT isn't ready for FreeBSD 6 yet.

Approved by: re

Revision 1.170: download - view: text, markup, annotated - select for diffs
Wed Dec 20 12:03:21 2006 UTC (5 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +2 -1 lines
In bge_txeof(), cancel the watchdog timeout if all descriptors have
been handled instead of when at least one descriptor was just handled.
For bge, it is normal to get a txeof when only a small fraction of the
queued tx descriptors have been handled, so the bug broke the watchdog
in a usual case.

Revision 1.169: download - view: text, markup, annotated - select for diffs
Wed Dec 20 11:14:45 2006 UTC (5 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +22 -6 lines
Avoid a race and a pessimization in bge_intr():

- moved the synchronizing bus read to after the bus write for the first
  interrupt ack so that it actually synchronizes everything necessary.

  We were acking not only the status update that triggered the interrupt
  together with any status updates that occurred before we got around
  to the bus write for the ack, but also any status updates that occur
  after we do the bus write but before the write reaches the device.
  The corresponding race for the second interrupt ack resulted in
  sometimes returning from the interrupt handler with acked but
  unserviced interrupt events.  Such events then remain unserviced
  until further events cause another interrupt or the watchdog times
  out.

  The race was often lost on my 5705, apparently since my 5705 has broken
  event coalescing which causes a status update for almost every packet,
  so another status update is quite likely to occur while the interrupt
  handler is running.  Watchdog timeouts weren't very noticeable,
  apparently because bge_txeof() has one of the usual bugs resetting the
  watchdog.

- don't disable device interrupts while bge_intr() is running.  Doing this
  just had the side effects of:
  - entering a device mode in which different coalescing parameters apply.
    Different coalescing parameters can be used to either inhibit or
    enhance the chance of getting another status update while in the
    interrupt handler.  This feature is useless with the current
    organization of the interrupt handler but might be useful with a
    taskqueue handler.
  - giving a race for ack+reenable/return.  This cannot be handled
    by simply rearranging the order of bus accesses like the race for
    ack+keepenable/entry.  It is necessary to sync the ack and then
    check for new events.
  - taking longer, especially with the extra code to avoid the race on
    ack+reenable/return.

Reviewed by:	ru, gleb, scottl

Revision 1.168: download - view: text, markup, annotated - select for diffs
Wed Dec 20 01:12:07 2006 UTC (5 years, 1 month ago) by jkim
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +5 -11 lines
Partially back out rev. 1.148 and use new ETHER_BPF_MTAP() macro for VLAN.
Remaining changes are cosmetic.

Revision 1.167: download - view: text, markup, annotated - select for diffs
Tue Dec 19 08:57:46 2006 UTC (5 years, 1 month ago) by oleg
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +10 -12 lines
- Add missing callout_drain() call.
- Synchronize bge_tick() with callout_reset/callout_stop() calls.
- Avoid using bge_tick() inside bge_link_upd(), use mii_pollstat() instead.

MFC after:	2 month

Revision 1.166: download - view: text, markup, annotated - select for diffs
Mon Dec 18 16:40:04 2006 UTC (5 years, 1 month ago) by jkim
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +19 -23 lines
- Remove stale VPD support and its comment and get device name from VPD API.
- Do not repeatedly read vendor/device IDs while probing.
- Remove redundant bzero(3) for softc.  device_get_softc(9) does it for free[1].

Reviewed by:	glebius
Suggested by:	glebius[1]

Revision 1.165: download - view: text, markup, annotated - select for diffs
Fri Dec 15 00:27:06 2006 UTC (5 years, 1 month ago) by jdp
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +9 -0 lines
Disable bge MSI support for now.  A couple of people warned me that there
are problems with it on several revisions of this chip.  I'll
re-enable it after I've sorted out which chip revisions work and which
don't.

Revision 1.164: download - view: text, markup, annotated - select for diffs
Thu Dec 14 23:10:12 2006 UTC (5 years, 1 month ago) by jdp
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +18 -4 lines
Add MSI support to the bge driver.  I tested this on a Dell SC1435
running an i386 kernel, and it worked fine.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Wed Dec 13 21:13:09 2006 UTC (5 years, 1 month ago) by scottl
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +15 -12 lines
Fix recent style problems and expand a comment.

Submitted by: Bruce Evans

Revision 1.162: download - view: text, markup, annotated - select for diffs
Wed Dec 13 21:03:55 2006 UTC (5 years, 1 month ago) by scottl
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +9 -5 lines
Use the BGE_IS_* macros consistently.  Also add a couple of missing
cases to the debug_info function.

Revision 1.161: download - view: text, markup, annotated - select for diffs
Wed Dec 13 20:51:51 2006 UTC (5 years, 1 month ago) by scottl
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +0 -6 lines
Remove a redundant write of the firmware reset magic number.  It looks to
have been added erroneously, and it causes problems on some chips.  A larger
change is needed to do this write at a more appropriate place, but that
change requires reworking the ASF logic.  That will be worked on in the
future.

Submitted by: Bruce Evans

Revision 1.160: download - view: text, markup, annotated - select for diffs
Wed Dec 13 17:28:51 2006 UTC (5 years, 1 month ago) by jkim
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +1 -8 lines
Use one counter instead of four to make up TX collision stats as BCM5705+.
It reduces chance of errors from multiple counter wraps at the same time.

Revision 1.159: download - view: text, markup, annotated - select for diffs
Tue Dec 12 05:11:12 2006 UTC (5 years, 2 months ago) by scottl
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +263 -35 lines
Fix support for certain 575x/578x chips.  This consists of the following:

- Use the appropriate register writing method when reseting the chip
- Program the descriptor DMA engine correctly.
- More reliably detect certain chips and their features.

Also add some low-level debugging tools to help future work on this driver.

Submitted by: David Christenson (proof of concept changes)
Sponsored by: www.UIA.net

Revision 1.158: download - view: text, markup, annotated - select for diffs
Mon Dec 11 18:00:34 2006 UTC (5 years, 2 months ago) by jkim
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +13 -10 lines
- Correct collision counter for BCM5705+.  This register is read/clear.
- Correct RX packet drop counter for BCM5705+.  This register is read/clear
and it wraps very quickly under heavy packet drops because only the lower
ten bits are valid according to the documentation.  However, it seems few
more bits are actually valid and the rest bits are always zeros[1].
Therefore, we don't mask them off here.  To get accurate packet drop count,
we need to check the register from bge_rxeof().  It is commented out for now,
not to penalize normal operation.  Actual performance impact should be
measured later.
- Correct integer casting from u_long to uint32_t.  Casting is not really
needed for all supported platforms but we better do this correctly[2].

Tested by:	bde[1]
Suggested by:	bde[2]

Revision 1.157: download - view: text, markup, annotated - select for diffs
Mon Dec 4 22:12:21 2006 UTC (5 years, 2 months ago) by jkim
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +22 -21 lines
- Add BGE_FLAG_JUMBO flag which idicates jumbo frame capability.  Some day we
may be able to support jumbo frames for BCM5714 and BCM5780.
- Rename BGE_IS_5705_OR_BEYOND() to BGE_IS_5705_PLUS() for consistency.

Revision 1.156: download - view: text, markup, annotated - select for diffs
Mon Dec 4 19:50:49 2006 UTC (5 years, 2 months ago) by jkim
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +38 -52 lines
Use bge_flags to save chipset family and remove dead code while I am here.

Revision 1.155: download - view: text, markup, annotated - select for diffs
Mon Dec 4 14:35:17 2006 UTC (5 years, 2 months ago) by glebius
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +1 -1 lines
Fix my error in rev. 1.152

Submitted by:	oleg

Revision 1.154: download - view: text, markup, annotated - select for diffs
Fri Dec 1 01:37:45 2006 UTC (5 years, 2 months ago) by jkim
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +1 -1 lines
Fix white spaces.

Revision 1.153: download - view: text, markup, annotated - select for diffs
Fri Dec 1 01:08:52 2006 UTC (5 years, 2 months ago) by jkim
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +15 -23 lines
Simplify statistics updates, remove redundant register reads, and add
discarded RX packets to input error for BCM5705 or newer chipset as the others.
Unfortunately we cannot do the same for output errors because ifOutDiscards
equivalent register does not exist.  While I am here, replace misleading and
wrong BGE_RX_STATS/BGE_TX_STATS with BGE_MAC_STATS.  They were reversed but
worked accidently.

Revision 1.152: download - view: text, markup, annotated - select for diffs
Thu Nov 30 13:40:39 2006 UTC (5 years, 2 months ago) by glebius
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +17 -24 lines
- Instead of if_watchdog/if_timer interface use our own timer
  that piggybacks on bge_tick() callout.
- Lock bge_tick() using callout_init_mtx().

Revision 1.151: download - view: text, markup, annotated - select for diffs
Thu Oct 19 08:03:22 2006 UTC (5 years, 3 months ago) by scottl
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +1 -1 lines
There is no reason to have a PAGE_SIZE alignment enforced on all DMA by the
parent tag.

Revision 1.91.2.18: download - view: text, markup, annotated - select for diffs
Fri Oct 13 08:05:55 2006 UTC (5 years, 3 months ago) by glebius
Branches: RELENG_6
CVS tags: RELENG_6_2_BP
Branch point for: RELENG_6_2
Diff to: previous 1.91.2.17: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.17: +0 -1 lines
MFC:
  Remove 3Com 985 deviceid that is really ti(4).

Approved by:	re (hrs)

Revision 1.150: download - view: text, markup, annotated - select for diffs
Tue Oct 3 09:31:49 2006 UTC (5 years, 4 months ago) by glebius
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +0 -1 lines
Remove 3Com 985 deviceid that is really ti(4).

Submitted by:	erwin

Revision 1.149: download - view: text, markup, annotated - select for diffs
Sat Sep 23 18:55:49 2006 UTC (5 years, 4 months ago) by scottl
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +12 -2 lines
Allow the ASF feature to be disabled via a tunable.  On one of my systems,
bringing up the bge interface results in a complete system freeze when
this feature is enabled.  Leave it enabled by default.

Revision 1.148: download - view: text, markup, annotated - select for diffs
Mon Sep 18 22:18:21 2006 UTC (5 years, 4 months ago) by jkim
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +28 -15 lines
Do not strip VLAN tag in promiscuous mode.

Revision 1.147: download - view: text, markup, annotated - select for diffs
Mon Sep 18 20:54:40 2006 UTC (5 years, 4 months ago) by jkim
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +13 -14 lines
Simplify promiscuous mode check and make ALLMULTI independent from it.

Revision 1.146: download - view: text, markup, annotated - select for diffs
Sun Sep 17 13:33:28 2006 UTC (5 years, 4 months ago) by andre
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +4 -6 lines
Move ethernet VLAN tags from mtags to its own mbuf packet header field
m_pkthdr.ether_vlan.  The presence of the M_VLANTAG flag on the mbuf
signifies the presence and validity of its content.

Drivers that support hardware VLAN tag stripping fill in the received
VLAN tag (containing both vlan and priority information) into the
ether_vtag mbuf packet header field:

	m->m_pkthdr.ether_vtag = vlan_id;	/* ntohs()? */
	m->m_flags |= M_VLANTAG;

to mark the packet m with the specified VLAN tag.

On output the driver should check the mbuf for the M_VLANTAG flag to
see if a VLAN tag is present and valid:

	if (m->m_flags & M_VLANTAG) {
		... = m->m_pkthdr.ether_vtag;	/* htons()? */
		... pass tag to hardware ...
	}

VLAN tags are stored in host byte order.  Byte swapping may be necessary.

(Note: This driver conversion was mechanic and did not add or remove any
byte swapping in the drivers.)

Remove zone_mtag_vlan UMA zone and MTAG_VLAN definition.  No more tag
memory allocation have to be done.

Reviewed by:	thompsa, yar
Sponsored by:	TCP/IP Optimization Fundraise 2005

Revision 1.145: download - view: text, markup, annotated - select for diffs
Fri Sep 15 15:16:10 2006 UTC (5 years, 4 months ago) by glebius
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +2 -2 lines
- Consistently use if_printf() only in interface methods: if_start(),
  if_watchdog, etc., or in functions used only in these methods.
  In all other functions in the driver use device_printf().
- Use __func__ instead of typing function name.

Submitted by:	Alex Lyashkov <umka sevcity.net>

Revision 1.144: download - view: text, markup, annotated - select for diffs
Sat Sep 9 03:36:57 2006 UTC (5 years, 5 months ago) by ambrisko
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +200 -10 lines
Add support to bge(4) to not break IPMI support when the driver attaches
to it.  Try to co-operate with the IPMI/ASF firmware accessing the PHY.
One we get link we don't mess with the PHY.  If we do then over time
the NIC will go off line.  It would be nice if we could tell if IPMI
was enabled on the chip but I can't figure out a reliable way to do
that.  The scheme I tried worked on a Dell PE850 but not on an HP machine.
So we assume any NIC that has ASF capability needs to deal with it.

The code was inspired by the support in Linux from kernel.org and Broadcom.
Broadcom did give me some info. but it is rather limited and is mostly
just what is in the Linux driver.  Thanks to the numerous people that
helped debug the many prior versions and that I didn't break other
bge(4) HW.

Reviewed by:	several people
Tested by:	even more

Revision 1.91.2.17: download - view: text, markup, annotated - select for diffs
Thu Sep 7 08:49:10 2006 UTC (5 years, 5 months ago) by oleg
Branches: RELENG_6
Diff to: previous 1.91.2.16: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.16: +24 -5 lines
MFC rev. 1.140
Properly lock ifmedia callbacks. This should prevent concurrent access to PHY.
Following issues should be resolved:
- random watchdog timeouts (caused by concurrent phy access)
- some link state issues
- non working TX if media type was set explicitly

PR:		kern/98738

Revision 1.143: download - view: text, markup, annotated - select for diffs
Sun Sep 3 00:27:41 2006 UTC (5 years, 5 months ago) by jmg
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +1 -1 lines
add a newbus method for obtaining the bus's bus_dma_tag_t...  This is
required by arches like sparc64 (not yet implemented) and sun4v where there
are seperate IOMMU's for each PCI bus...  For all other arches, it will
end up returning NULL, which makes it a no-op...

Convert a few drivers (the ones we've been working w/ on sun4v) to the
new convection...  Eventually all drivers will need to replace the parent
tag of NULL, w/ bus_get_dma_tag(dev), though dev is usually different for
each driver, and will require hand inspection...

Reviewed by:	scottl (earlier version)

Revision 1.142: download - view: text, markup, annotated - select for diffs
Fri Sep 1 22:45:11 2006 UTC (5 years, 5 months ago) by davidch
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +0 -0 lines
Resolve "firmware handshake" error on 5752.

Approved by:	ps
MFC after:	2 weeks

Revision 1.141: download - view: text, markup, annotated - select for diffs
Fri Sep 1 22:30:56 2006 UTC (5 years, 5 months ago) by davidch
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +6 -5 lines
/tmp/cvsleYf6y

Revision 1.140: download - view: text, markup, annotated - select for diffs
Thu Aug 24 14:41:16 2006 UTC (5 years, 5 months ago) by oleg
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +24 -5 lines
Properly lock ifmedia callbacks. This should prevent concurrent access to PHY.
Following issues should be resolved:
- random watchdog timeouts (caused by concurrent phy access)
- some link state issues
- non working TX if media type was set explicitly

PR:		kern/98738
Approved by:	glebius (mentor)
MFC after:	2 weeks

Revision 1.139: download - view: text, markup, annotated - select for diffs
Wed Aug 23 11:32:54 2006 UTC (5 years, 5 months ago) by glebius
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +36 -31 lines
Pack several boolean fields into single bge_flags field.

Revision 1.138: download - view: text, markup, annotated - select for diffs
Fri Aug 18 13:53:53 2006 UTC (5 years, 5 months ago) by glebius
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +19 -20 lines
bge_cksum_pad() can modify the mbuf, thus call it before bus_dmamap_load().

Submitted by:	yongari

Revision 1.137: download - view: text, markup, annotated - select for diffs
Thu Aug 17 09:53:04 2006 UTC (5 years, 5 months ago) by glebius
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +48 -38 lines
Rewrite bge_encap() so that it takes mbuf ** argument. In this case if
m_defrag(9) changes pointer we can show this to our caller.

Reviewed by:	yongari

Revision 1.91.2.16: download - view: text, markup, annotated - select for diffs
Thu Aug 10 11:02:14 2006 UTC (5 years, 6 months ago) by glebius
Branches: RELENG_6
Diff to: previous 1.91.2.15: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.15: +1 -0 lines
MFC:
  Recognize the 5750 C2.

  Obtained from:  OpenBSD (brad)

Revision 1.136: download - view: text, markup, annotated - select for diffs
Mon Aug 7 12:51:50 2006 UTC (5 years, 6 months ago) by glebius
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +1 -0 lines
Recognize the 5750 C2.

Obtained from:	OpenBSD (brad)

Revision 1.91.2.15: download - view: text, markup, annotated - select for diffs
Wed Aug 2 15:01:59 2006 UTC (5 years, 6 months ago) by glebius
Branches: RELENG_6
Diff to: previous 1.91.2.14: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.14: +586 -716 lines
Sync with HEAD merging many things:

- Support for BCM5754, BCM5755, BCM5787.
- Recognize BCM5703 B0 ASIC.
- Correctly recognize chips that can do Jumbo.
- Fix kern/68351
- Rewrite arrays that hold names of chips and
  revisions.

Also:
- Big style(9) and whitespace cleanup.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Thu Jun 29 06:38:21 2006 UTC (5 years, 7 months ago) by glebius
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +0 -3 lines
Since 5714 family doesn't have Jumbo ring, we do not support
Jumbos on them, yet. The 5780 is equivalent to the 5714.

Submitted by:	brad@OpenBSD, davidch

Revision 1.134: download - view: text, markup, annotated - select for diffs
Wed Jun 28 09:12:29 2006 UTC (5 years, 7 months ago) by glebius
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +34 -34 lines
- Recognize more device IDs adding support for BCM5754, BCM5755,
  BCM5787 based NICs.
- Recognize BCM5703 B0 ASIC.
- Rewrite the jumbo capability matching macro, so that chips known
  to work are listed there. [*]

[*] I'm still not sure about this. Probably more corrections
    will be done to this macro after discussion with davidch@
    and brad@OpenBSD.

Obtained from:	OpenBSD (brad)

Revision 1.133: download - view: text, markup, annotated - select for diffs
Thu Jun 15 14:35:31 2006 UTC (5 years, 7 months ago) by glebius
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +0 -0 lines
Forced commit to note that previous commit was also:

Partially submitted by:	Pavel Merdin <freebsd-bugs merdin.com>
Tested by:		Lucas Nussbaum <lucas.nussbaum imag.fr>

Revision 1.132: download - view: text, markup, annotated - select for diffs
Thu Jun 15 14:31:49 2006 UTC (5 years, 7 months ago) by glebius
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +323 -272 lines
Possess some work from OpenBSD, with some local additions.

- Add more device IDs, ASIC revisions and chip IDs.
- Rewrite a bit code that picks the description for device.
- Introduce several macros to shorten quirks for bugs and
  features.[*]
- Use some magic values, that OpenBSD has successfully
  possessed from Linux (Broadcom supplied) driver.
- Remove disabled code that tried to access VPD.

[*] The macro that matches Jumbo capable NICs is
    rewritten to preserve our current behavior. I
    need clarify whether our or theirs is correct.

PR:		68351 (and may be others)
Obtained from:	OpenBSD, brad@ mostly

Revision 1.131: download - view: text, markup, annotated - select for diffs
Thu Jun 8 10:19:16 2006 UTC (5 years, 8 months ago) by glebius
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +9 -9 lines
Whitespace.

Revision 1.130: download - view: text, markup, annotated - select for diffs
Wed Jun 7 21:03:20 2006 UTC (5 years, 8 months ago) by glebius
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +267 -442 lines
- style(9) cleanup.
- Fix comments and printf()s about allocating jumbo buffers.

Revision 1.91.2.14: download - view: text, markup, annotated - select for diffs
Fri May 19 19:15:05 2006 UTC (5 years, 8 months ago) by ps
Branches: RELENG_6
Diff to: previous 1.91.2.13: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.13: +10 -14 lines
MFC: rev 1.126
Fix the interrupt handler to do the mandatory PCI flush before looking at
DMA memory.  The could contribute towards missed link state changes under
heavy bus load.

Revision 1.129: download - view: text, markup, annotated - select for diffs
Tue May 16 14:36:23 2006 UTC (5 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +0 -1 lines
Since DELAY() was moved,  most <machine/clock.h> #includes have been
unnecessary.

Revision 1.128: download - view: text, markup, annotated - select for diffs
Tue Apr 25 17:54:42 2006 UTC (5 years, 9 months ago) by mjacob
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +0 -2 lines
If one removes the option from conf/options, one should
remove the include of the derived file opt_bge.h as well.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Tue Apr 25 15:56:52 2006 UTC (5 years, 9 months ago) by mr
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +5 -3 lines
make BGE_FAKE_AUTONEG a tunable.
This allows one to change the behavior of the driver pre-boot.

NOTE: This patch was made for DragonFly BSD by Sepherosa Ziehau.

PR:		kern/94833
Submitted by:	Devon H. O'Dell
Obtained from:	DragonFly
MFC after:	1 month

Revision 1.126: download - view: text, markup, annotated - select for diffs
Sat Apr 15 08:13:06 2006 UTC (5 years, 9 months ago) by scottl
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +10 -14 lines
Fix the interrupt handler to do the mandatory PCI flush before looking at
DMA memory.  The could contribute towards missed link state changes under
heavy bus load.

Revision 1.125: download - view: text, markup, annotated - select for diffs
Fri Mar 17 09:17:36 2006 UTC (5 years, 10 months ago) by glebius
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +0 -2 lines
Remove dead code.

Submitted by:	oleg

Revision 1.91.2.13: download - view: text, markup, annotated - select for diffs
Sat Mar 4 09:34:48 2006 UTC (5 years, 11 months ago) by oleg
Branches: RELENG_6
CVS tags: RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1
Diff to: previous 1.91.2.12: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.12: +44 -25 lines
MFC rev. 1.121-1.124

- Synchronize status block on every call of bge_poll_locked() (rev. 1.121)
- Return immediately out of bge_rxeof()/bge_txeof() if there are no packets
  to process. This could save some pci register accesses. (rev. 1.122)
- Enable 'complete' (including tcp/udp pseudo header) hardware rx checksum
  offloading. (rev. 1.123)
- Ignore link events for MII/GMII cards if MI auto-polling disabled.(rev. 1.124)
- Clear bge_link flag in bge_stop() (rev. 1.124)
- Force link state check after bge_ifmedia_upd(). Otherwise we can miss link
  event if PHY changes it's state fast enough.(rev. 1.124)
- Fix some comments.

Approved by:	re (scottl)

Revision 1.124: download - view: text, markup, annotated - select for diffs
Fri Feb 17 14:33:35 2006 UTC (5 years, 11 months ago) by oleg
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +14 -4 lines
1) Ignore link events for MII/GMII cards if MI auto-polling disabled. This
   should fix strange link state behaviour reported for bcm5721 & bcm5704c
2) Clear bge_link flag in bge_stop()
3) Force link state check after bge_ifmedia_upd(). Otherwise we can miss link
   event if PHY changes it's state fast enough.

Tested by:	phk (bcm5704c)
Approved by:	glebius (mentor)
MFC after:	1 week

Revision 1.91.2.12: download - view: text, markup, annotated - select for diffs
Sun Feb 5 18:07:15 2006 UTC (6 years ago) by oleg
Branches: RELENG_6
Diff to: previous 1.91.2.11: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.11: +29 -24 lines
MFC 1.120:
1) Fix link state detection for cards operating in TBI mode (fiber ones)
2) add missing bus_dmamap_sync() call in bge_intr()

Approved by:	re (scottl)

Revision 1.91.2.11: download - view: text, markup, annotated - select for diffs
Fri Feb 3 15:56:42 2006 UTC (6 years ago) by ru
Branches: RELENG_6
Diff to: previous 1.91.2.10: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.10: +4 -1 lines
MFC: 1.119: Make sure we reprogram multicast filter on IFF_ALLMULTI.

Approved by:	re (kensmith)

Revision 1.123: download - view: text, markup, annotated - select for diffs
Thu Feb 2 09:58:31 2006 UTC (6 years ago) by oleg
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +3 -2 lines
Enable 'complete' rx checksum offloading (i.e. let chip calculate checksums
with pseudo header for tcp/udp packets). This could save one in_pseudo() call
per incoming tcp/udp packet.

Approved by:	glebius (mentor)
MFC after:	3 weeks

Revision 1.122: download - view: text, markup, annotated - select for diffs
Wed Feb 1 15:16:03 2006 UTC (6 years ago) by oleg
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +10 -4 lines
Optimize bge_rxeof() & bge_txeof(): return immediately if there are no packets
to process. It could give us [significant?] perfomance increase if there is big
difference between RX/TX flows.

Submitted by:	Mihail Balikov <mihail.balikov AT interbgc DOT com>
Approved by:	glebius (mentor)
MFC after:	3 days

Revision 1.121: download - view: text, markup, annotated - select for diffs
Wed Feb 1 14:41:08 2006 UTC (6 years ago) by oleg
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +16 -14 lines
Since bge_rxeof() & bge_txeof() depends on status block data it should be
synchronized on every call of bge_poll_locked().

Suggested by:	Mihail Balikov <mihail.balikov AT interbgc DOT com>
Approved by:	glebius (mentor)
MFC after:	3 days

Revision 1.120: download - view: text, markup, annotated - select for diffs
Wed Feb 1 14:26:35 2006 UTC (6 years ago) by oleg
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +29 -24 lines
1) Fix link state detection for cards operating in TBI mode (fiber ones)
2) add missing bus_dmamap_sync() call in bge_intr()

Tested by:	Husnu Demir <hdemir AT metu DOT edu DOT tr>
Approved by:	glebius (mentor)
MFC after:	3 days

Revision 1.3.2.41: download - view: text, markup, annotated - select for diffs
Wed Feb 1 10:15:12 2006 UTC (6 years ago) by ru
Branches: RELENG_4
Diff to: previous 1.3.2.40: preferred, colored
Changes since revision 1.3.2.40: +4 -1 lines
MFC: Make multicast routing rolling on bge's.

Revision 1.119: download - view: text, markup, annotated - select for diffs
Wed Feb 1 10:11:24 2006 UTC (6 years ago) by ru
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +4 -1 lines
Setting IFF_ALLMULTI on a running interface didn't call bge_setmulti()
as intended, resulting in a non-working multicast routing.  Fix it.

MFC after:	3 days

Revision 1.118: download - view: text, markup, annotated - select for diffs
Mon Jan 30 13:45:55 2006 UTC (6 years ago) by glebius
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +2 -1 lines
This driver can do hardware VLAN tagging + checksum offloading.

In collaboration with:	Mihail Balikov <mihail.balikov interbgc.com>

Revision 1.91.2.10: download - view: text, markup, annotated - select for diffs
Mon Jan 30 13:17:44 2006 UTC (6 years ago) by glebius
Branches: RELENG_6
Diff to: previous 1.91.2.9: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.9: +7 -13 lines
MFC 1.116:
  Check for BGE_RXBDFLAG_IP_CSUM flag before marking mbuf as with valid
  checksum. This fixes operation of PPPoE and other non-IP Ethernet
  protocols.
MFC 1.117:
  Use m_getcl() instead of getting mbuf, and then getting a cluster.

Revision 1.72.2.16: download - view: text, markup, annotated - select for diffs
Sun Jan 29 15:39:03 2006 UTC (6 years ago) by emaste
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5
Diff to: previous 1.72.2.15: preferred, colored; branchpoint 1.72: preferred, colored; next MAIN 1.73: preferred, colored
Changes since revision 1.72.2.15: +2 -0 lines
Merge IP multicast address list locking from HEAD to RELENG_5.
if_ath.c:1.99 awi.c:1.39 if_bfe.c:1.26 if_bge.c:1.92 if_ed.c:1.255
if_em.c:1.67 if_ex.c:1.57 if_fe.c:1.92 if_fxp.c:1.242 if_gem.c:1.32
if_hme.c:1.38 if_ie.c:1.103 if_ndis.c:1.100 if_ixgb.c:1.12 if_lge.c:1.40
if_lnc.c:1.112 if_my.c:1.30 if_nge.c:1.76 if_nve.c:1.9 if_owi.c:1.11
pdq_ifsubr.c:1.27 if_ray.c:1.80 if_re.c:1.47 if_sn.c:1.47 dp83932.c:1.20
if_tx.c:1.90 if_txp.c:1.32 if_aue.c:1.91 if_axe.c:1.31 if_cue.c:1.58
if_kue.c:1.65 if_rue.c:1.22 if_udav.c:1.15 if_vge.c:1.15 if_wi.c:1.182
if_wl.c:1.67 if_xe.c:1.58 if_dc.c:1.161 if_de.c:1.167 if_pcn.c:1.70
if_rl.c:1.153 if_sf.c:1.83 if_sis.c:1.134 if_sk.c:1.107 if_ste.c:1.85
if_ti.c:1.108 if_tl.c:1.100 if_vr.c:1.105 if_wb.c:1.80 if_xl.c:1.193:

  Modify device drivers supporting multicast addresses to lock if_addr_mtx
  over iteration of their multicast address lists when synchronizing the
  hardware address filter with the network stack-maintained list.

Note that with these changes, these drivers now depend on locking the global
if_addr_mtx, so binary modules of these drivers will not work on 5.4 or
earlier releases.

Approved by:    rwatson (mentor)

Revision 1.117: download - view: text, markup, annotated - select for diffs
Mon Jan 23 15:57:02 2006 UTC (6 years ago) by glebius
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +2 -9 lines
Use m_getcl() instead of getting mbuf, and then getting a cluster.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Sat Jan 21 09:54:32 2006 UTC (6 years ago) by glebius
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +5 -4 lines
Check for BGE_RXBDFLAG_IP_CSUM flag before marking mbuf as with valid
checksum. This fixes operation of PPPoE and other non-IP Ethernet
protocols.

Revision 1.91.2.9: download - view: text, markup, annotated - select for diffs
Thu Jan 19 13:36:26 2006 UTC (6 years ago) by glebius
Branches: RELENG_6
Diff to: previous 1.91.2.8: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.8: +599 -664 lines
Sync driver with HEAD merging all revisions from 1.96 to 1.115. The most
markable changes are:

 o Suspend/resume methods.
 o Link state detection fixes.
 o Utilization of jumbo allocator and extended RX descriptors.
 o busdma(9) cleanup and support for big-endian architectures.
 o Improved checksum offloading support.
 o Reduced number of PCI register writes in bge_start().
 o Counting RX/TX errors as input/output interface errors.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Wed Jan 18 14:31:21 2006 UTC (6 years ago) by glebius
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +22 -12 lines
Be ready to a case when not a constant number of segments is returned
by bus_dmamap_load_mbuf_sg() on jumbo buffer allocation.

Reviewed by:	scottl, gallatin

Revision 1.114: download - view: text, markup, annotated - select for diffs
Tue Jan 17 23:01:57 2006 UTC (6 years ago) by oleg
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +30 -29 lines
 - Count packets discarded by RX/TX MAC (cause of FIFO overflow, etc)
   as input/output interface errors.
 - Keep values of rx/tx discards & tx collisions inside struct bge_softc.
   So we can keep statistic across ifconfig down/up runs (cause bringing
   bge up will reset chip).

Approved by:	glebius (mentor)
MFC after:	1 week

Revision 1.3.2.40: download - view: text, markup, annotated - select for diffs
Tue Jan 17 10:41:06 2006 UTC (6 years ago) by ru
Branches: RELENG_4
Diff to: previous 1.3.2.39: preferred, colored
Changes since revision 1.3.2.39: +117 -11 lines
MFC: polling(4) support for bge(4).

Revision 1.91.2.8: download - view: text, markup, annotated - select for diffs
Fri Jan 13 19:21:43 2006 UTC (6 years ago) by glebius
Branches: RELENG_6
Diff to: previous 1.91.2.7: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.7: +1 -1 lines
- Restore VLAN_INPUT_TAG() macro to preserve API compatibility for
  third party drivers.
- Fix bugs destribed in previous revision using macro with
  another name.

Revision 1.91.2.7: download - view: text, markup, annotated - select for diffs
Fri Jan 13 11:51:08 2006 UTC (6 years ago) by glebius
Branches: RELENG_6
Diff to: previous 1.91.2.6: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.6: +5 -2 lines
MFC:
  - Use VLAN_TAG_VALUE() not only to read a dot1q tag
    value from an m_tag, but also to set it.  This reduces
    complex code duplication and improves its readability.
  - Fix VLAN_INPUT_TAG() macro, so that it doesn't touch mtag in
    case if memory allocation failed.
  - Remove fourth argument from VLAN_INPUT_TAG(), that was used
    incorrectly in almost all drivers. Indicate failure with
    mbuf value of NULL.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Fri Jan 13 08:59:40 2006 UTC (6 years ago) by oleg
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +101 -60 lines
1) move all link state detection code from bge_tick_locked() to bge_link_upd()
2) use more robust way of link state handling for BCM5700 rev.B2 chip
3) workaround bug of some BCM570x chips which cause spurious "link up" messages
4) fix bug: some BCM570x chips was unable to detect link state changes after
   ifconfig down/up sequence until any 'non-link related' interrupt generated.
   (this happened due to pending internal link state attention which blocked
   interrupt generation)

Approved by:	glebius (mentor)
MFC after:	1 week

Revision 1.112: download - view: text, markup, annotated - select for diffs
Fri Dec 23 02:04:41 2005 UTC (6 years, 1 month ago) by yongari
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +51 -52 lines
Use device_printf() and if_printf() rather than printf() and axe
bge_unit from the softc.

Requested by:	marius

Revision 1.111: download - view: text, markup, annotated - select for diffs
Thu Dec 22 15:14:42 2005 UTC (6 years, 1 month ago) by glebius
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +69 -10 lines
- All bge(4) supported hardware is known to support RX/TX checksum offloading,
  except for BGE_CHIPID_BCM5700_B0, which is buggy.
- All bge(4) supported hardware, has a bug that produces incorrect checksums
  on Ethernet runts. However, in case of a transmitted packet, the latter can
  be padded with zeroes, and the checksum would be correct. (Probably chip
  includes the pad data into checksum). In case of receive, we just don't
  trust checksum data in received runts.

Obtained from:	NetBSD (jonathan) via Mihail Balikov

Revision 1.110: download - view: text, markup, annotated - select for diffs
Thu Dec 22 02:03:57 2005 UTC (6 years, 1 month ago) by yongari
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +8 -3 lines
Fix bge_eeprom_getbyte() to return 1 when timeout happens.
Previously it always returned 0 which means success regardless of
EEPROM status.

While here, add a check whether EEPROM read is successful.

Submitted by:   jkim

Revision 1.109: download - view: text, markup, annotated - select for diffs
Thu Dec 22 01:44:27 2005 UTC (6 years, 1 month ago) by yongari
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +75 -92 lines
Add bge(4) support for big-endian architectures(part 2/2).
 - removed unused funtion bge_handle_events().
 - removed bus_dmamap_destroy(9) calls for DMA maps created by
   bus_dmamem_alloc(9). This should fix panics seen on sparc64
   in device detach.
 - added check for parent DMA tag creation.
 - switched to use __NO_STRICT_ALIGNMENT as bge(4) supports all
   architectures.
 - added missing bus_dmamap_sync(9) in bge_txeof().
 - added missing bus_dmamap_sync(9) in bge_encap().
 - corrected memory synchronization operation on status block.
   As the driver just read status block that was DMAed by NIC it
   should use BUS_DMASYNC_POSTREAD. Likewise the driver does not
   need to write status block back, so remove unnecessary
   bus_dmamap_sync(9) calls in bge_intr().
 - corrected memory synchronization operation on RX return ring.
   The driver only read the block so remove unnecessary
   bus_dmamap_sync(9) in bge_rxeof().
 - force bus_dmamap_sync(9) for only modified descriptors. Blindly
   synching all desciptor rings would reduce performance.
 - call bus_dmamap_sync(9) for DMA maps that were modified in bge_rxeof().

Reviewed by:	jkim(initial version)
Tested by:	glebius(i386), jkim(amd64 initial version)

Revision 1.108: download - view: text, markup, annotated - select for diffs
Sun Dec 18 20:26:12 2005 UTC (6 years, 1 month ago) by glebius
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +10 -4 lines
Since BGE_MBX_TX_HOST_PROD0_LO register is write-only to software,
we can cache its value in the softc. Eliminates one PCI register
write per call to bge_start().

A 1.8% speedup for UDP_RR test on my old box.

Obtained from:	NetBSD(jonathan) via delphij

Revision 1.107: download - view: text, markup, annotated - select for diffs
Sun Dec 18 18:24:26 2005 UTC (6 years, 1 month ago) by glebius
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +5 -2 lines
- Fix VLAN_INPUT_TAG() macro, so that it doesn't touch mtag in
  case if memory allocation failed.
- Remove fourth argument from VLAN_INPUT_TAG(), that was used
  incorrectly in almost all drivers. Indicate failure with
  mbuf value of NULL.

In collaboration with:	yongari, ru, sam

Revision 1.106: download - view: text, markup, annotated - select for diffs
Thu Dec 15 09:45:53 2005 UTC (6 years, 1 month ago) by glebius
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +55 -82 lines
o Rewrite bge_encap() to use bus_dmamap_load_mbuf_sg(9), inlining the
  callback function bge_dma_map_tx_desc() into the bge_encap() itself.
o If busdma returns EFBIG, try to m_defrag() the packet.

Reviewed by:	yongari

Revision 1.105: download - view: text, markup, annotated - select for diffs
Thu Dec 15 05:48:49 2005 UTC (6 years, 1 month ago) by yongari
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +74 -80 lines
Add bge(4) support for big-endian architectures(part 1/2).
 - Give up endianess support and switch to native-endian format for
   accessing hardware structures. In fact embedded processor for
   BCM57xx is big-endian architure(MIPS) and it requires native-endian
   format for NIC structures.The NIC performs necessary byte/word
   swapping depending on programmed endian type.
 - With above changes all htole16/htole32 calls were gone.
 - Remove bge_vhandle member in softc and changed to use explicit
   register access. This may add additional performance penalty
   that than that of previous memory access. But most of the access
   is performed on initialization phase(e.g. RCB setup), it would be
   negligible.

Due to incorrect use of bus_dma(9) in bge(4) it still panics sparc64
system in device detach path. The issue would be fixed in next patch.

Reviewed by:	jkim (initial version)
Silence from:	ps
Tested by:	glebius
Obtained from:	NetBSD via OpenBSD

Revision 1.104: download - view: text, markup, annotated - select for diffs
Tue Dec 13 06:14:14 2005 UTC (6 years, 1 month ago) by marcel
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +2 -4 lines
In bge_link_upd(), rewrite the logic so that status is assigned
on the code path it is used in a way that GCC understands. This
avoids breakage due to higher optimization levels.

Revision 1.103: download - view: text, markup, annotated - select for diffs
Thu Dec 8 16:11:45 2005 UTC (6 years, 2 months ago) by glebius
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +49 -233 lines
A big rewrite of receive Jumbo frame handling. Remove the local Jumbo
cluster allocator, that wasn't MPSAFE. Instead, utilize our new generic
UMA jumbo cluster allocator. Since UMA gives us a 9k piece that is contigous
in virtual memory, but isn't contigous in physical memory we need to handle
a few segments. To deal with this we utilize Tigon chip feature - extended
RX descriptors, that can handle up to four DMA segments for one frame.

Details:

o Remove bge_alloc_jumbo_mem(), bge_free_jumbo_mem(),
  bge_jalloc(), bge_jfree() functions.
o Remove SLIST heads, bge_jumbo_tag, bge_jumbo_map from softc.
o Use extended RX BDs for Jumbo receive producer ring, and
  initialize it appropriately.
o New bge_newbuf_jumbo():
  - Allocate an mbuf with Jumbo cluster with help of m_cljget().
  - Load the cluster for DMA with help of bus_dmamap_load_mbuf_sg().
  - Assert that we got 3 segments in the DMA mapping.
  - Fill in these 3 segments into the extended RX descriptor.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Thu Dec 8 13:31:52 2005 UTC (6 years, 2 months ago) by oleg
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +115 -105 lines
1) fix tiny bug in bge_start_locked()
2) rework link state detection code & use it in POLLING mode
3) fix 2 bugs in link state detection code:
	a) driver unable to detect link loss on bcm5721
	b) on bcm570x chips (tested on bcm5700 bcm5701 bcm5702) driver fails
	   to detect link loss with probability 1/6 (solved in brgphy.c)

Devices working in TBI mode should not be affected by this change.

Approved by:	glebius (mentor)
MFC after:	1 month

Revision 1.101: download - view: text, markup, annotated - select for diffs
Wed Nov 30 12:37:07 2005 UTC (6 years, 2 months ago) by glebius
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +6 -2 lines
If bus_dmamap_load() failed, we free the mbuf. We also need to clear
the pointer, to avoid double free on next bge_stop().

Revision 1.72.2.15: download - view: text, markup, annotated - select for diffs
Fri Nov 25 14:44:06 2005 UTC (6 years, 2 months ago) by glebius
Branches: RELENG_5
Diff to: previous 1.72.2.14: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.14: +5 -2 lines
MFC:
  Recognize Broadcom BCM5752 chip, that can be found in HP DC7600.

  PR:             kern/88940
  Submitted by:   Alexander Hausner

Revision 1.91.2.6: download - view: text, markup, annotated - select for diffs
Fri Nov 25 14:43:12 2005 UTC (6 years, 2 months ago) by glebius
Branches: RELENG_6
Diff to: previous 1.91.2.5: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.5: +5 -2 lines
MFC:
  Recognize Broadcom BCM5752 chip, that can be found in HP DC7600.

  PR:		kern/88940
  Submitted by:	Alexander Hausner

Revision 1.100: download - view: text, markup, annotated - select for diffs
Tue Nov 15 14:43:22 2005 UTC (6 years, 2 months ago) by glebius
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +5 -2 lines
Recognize Broadcom BCM5752 chip, that can be found in HP DC7600.

PR:		kern/88940
Submitted by:	Alexander Hausner

Revision 1.99: download - view: text, markup, annotated - select for diffs
Fri Nov 11 16:04:50 2005 UTC (6 years, 3 months ago) by ru
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +4 -4 lines
- Store pointer to the link-level address right in "struct ifnet"
  rather than in ifindex_table[]; all (except one) accesses are
  through ifp anyway.  IF_LLADDR() works faster, and all (except
  one) ifaddr_byindex() users were converted to use ifp->if_addr.

- Stop storing a (pointer to) Ethernet address in "struct arpcom",
  and drop the IFP2ENADDR() macro; all users have been converted
  to use IF_LLADDR() instead.

Revision 1.91.2.5: download - view: text, markup, annotated - select for diffs
Wed Nov 9 11:42:01 2005 UTC (6 years, 3 months ago) by glebius
Branches: RELENG_6
Diff to: previous 1.91.2.4: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.4: +110 -2 lines
MFC polling(4) for bge(4).

Revision 1.98: download - view: text, markup, annotated - select for diffs
Sat Oct 22 14:31:01 2005 UTC (6 years, 3 months ago) by glebius
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +110 -2 lines
Introduce polling(4) capability for bge(4).

Submitted by:	Oleg Bulyzhin <oleg rinet.ru>

Revision 1.97: download - view: text, markup, annotated - select for diffs
Sat Oct 22 05:06:54 2005 UTC (6 years, 3 months ago) by imp
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +1 -1 lines
Replace FreeBSD 3.x syntax (controller miibus0) with 4.x syntax
(device miibus) in time for 7.0 :-)

Revision 1.91.2.4: download - view: text, markup, annotated - select for diffs
Sun Oct 9 04:15:11 2005 UTC (6 years, 4 months ago) by delphij
Branches: RELENG_6
CVS tags: RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Diff to: previous 1.91.2.3: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.3: +3 -2 lines
MFC (by ru)
| Fix "struct ifnet" leaks when attach() fails in the middle.
|
| Revision  Changes    Path
| 1.28      +4 -5      src/sys/dev/bfe/if_bfe.c
| 1.95      +3 -2      src/sys/dev/bge/if_bge.c
| 1.21      +2 -0      src/sys/dev/cnw/if_cnw.c
| 1.261     +2 -1      src/sys/dev/ed/if_ed.c
| 1.38      +9 -2      src/sys/dev/en/if_en_pci.c
| 1.59      +3 -1      src/sys/dev/ex/if_ex.c
| 1.26      +4 -3      src/sys/dev/hatm/if_hatm.c
| 1.105     +2 -1      src/sys/dev/ie/if_ie.c
| 1.17      +2 -1      src/sys/dev/vge/if_vge.c

Approved by:	re (scottl)

Revision 1.96: download - view: text, markup, annotated - select for diffs
Wed Sep 28 19:20:49 2005 UTC (6 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +36 -0 lines
Implement suspend/resume methods to be more ACPI friendly.
I'm able to suspend/resume my laptop without this change, but then I need
to wait for the watchdog to reset the card.
With this change, it is ready immediately.

Glanced at by:	glebius

Revision 1.95: download - view: text, markup, annotated - select for diffs
Fri Sep 16 11:25:16 2005 UTC (6 years, 4 months ago) by ru
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +3 -2 lines
Fix "struct ifnet" leaks when attach() fails in the middle.

Revision 1.91.2.3: download - view: text, markup, annotated - select for diffs
Thu Sep 15 14:10:41 2005 UTC (6 years, 4 months ago) by pjd
Branches: RELENG_6
Diff to: previous 1.91.2.2: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.2: +10 -5 lines
MFC:	sys/dev/bge/if_bge.c	1.94

When bge_stop() is called from bge_detach(), mii is already NULL, so check
before trying to use it.
This fix allows to 'kldunload if_bge' without panicing.

Reviewed by:	bz
Approved by:	re (scottl)

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun Sep 4 06:35:59 2005 UTC (6 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +10 -5 lines
When bge_stop() is called from bge_detach(), mii is already NULL, so check
before trying to use it.
This fix allows to 'kldunload if_bge' without panicing.

Reviewed by:	bz
MFC after:	3 days

Revision 1.91.2.2: download - view: text, markup, annotated - select for diffs
Thu Aug 25 05:01:05 2005 UTC (6 years, 5 months ago) by rwatson
Branches: RELENG_6
Diff to: previous 1.91.2.1: preferred, colored; branchpoint 1.91: preferred, colored
Changes since revision 1.91.2.1: +16 -15 lines
Merge linux_ioctl.c:1.128 svr4_sockio.c:1.17 altq_cbq.c:1.3 if_oltr.c:1.38
if_pflog.c:1.14 if_pfsync.c:1.21 if_an.c:1.70 if_ar.c:1.72 if_arl.c:1.11
amrr.c:1.10 onoe.c:1.10 if_ath.c:1.101 awi.c:1.41 if_bfe.c:1.27
if_bge.c:1.93 if_cm_isa.c:1.7 smc90cx6.c:1.16 if_cnw.c:1.20 if_cp.c:1.25
if_cs.c:1.42 if_ct.c:1.26 if_cx.c:1.46 if_ed.c:1.256 if_em.c:1.68
if_en_pci.c:1.37 midway.c:1.66 if_ep.c:1.143 if_ex.c:1.58 if_fatm.c:1.20
if_fe.c:1.93 if_fwe.c:1.38 if_fwip.c:1.8 if_fxp.c:1.244 if_gem.c:1.33
if_hatm.c:1.25 if_hatm_intr.c:1.20 if_hatm_ioctl.c:1.13 if_hatm_rx.c:1.10
if_hatm_tx.c:1.14 if_hme.c:1.39 if_ie.c:1.104 if_ndis.c:1.101
if_ic.c:1.24 if_ipw.c:1.10 if_iwi.c:1.10 if_ixgb.c:1.13 if_lge.c:1.41
if_lnc.c:1.113 if_my.c:1.31 if_nge.c:1.77 if_nve.c:1.10 if_owi.c:1.12
if_patm.c:1.9 if_patm_intr.c:1.6 if_patm_ioctl.c:1.10 if_patm_tx.c:1.10
pdq_ifsubr.c:1.28 if_plip.c:1.38 if_ral.c:1.12 if_ral_pci.c:1.2
if_ray.c:1.81 if_rayvar.h:1.22 if_re.c:1.49 if_sbni.c:1.21 if_sbsh.c:1.14
if_sn.c:1.48 dp83932.c:1.21 if_snc_pccard.c:1.9 if_sr.c:1.70 if_tx.c:1.91
if_txp.c:1.33 if_aue.c:1.92 if_axe.c:1.32 if_cdce.c:1.8 if_cue.c:1.59
if_kue.c:1.66 if_rue.c:1.23 if_udav.c:1.16 if_ural.c:1.12 if_vge.c:1.16
if_vx.c:1.58 if_wi.c:1.185 if_wi_pci.c:1.26 if_wl.c:1.68 if_xe.c:1.60
if_xe_pccard.c:1.30 if_el.c:1.68 i4b_ipr.c:1.35 i4b_isppp.c:1.31
kern_poll.c:1.20 bridge.c:1.94 bridgestp.c:1.4 if_arcsubr.c:1.27
if_atm.h:1.24 if_atmsubr.c:1.40 if_bridge.c:1.16 if_ef.c:1.35
if_ethersubr.c:1.196 if_faith.c:1.37 if_fddisubr.c:1.100 if_fwsubr.c:1.14
if_gif.c:1.54 if_gre.c:1.34 if_iso88025subr.c:1.70 if_loop.c:1.107
if_ppp.c:1.106 if_spppsubr.c:1.121 if_tap.c:1.57 if_tun.c:1.154
if_vlan.c:1.80 ppp_tty.c:1.67 ieee80211_ioctl.c:1.32 atm_if.c:1.31
ng_eiface.c:1.33 ng_ether.c:1.50 ng_fec.c:1.19 ng_iface.c:1.44
ng_sppp.c:1.9 ip_carp.c:1.30 ip_fastfwd.c:1.30 in6.c:1.53 nd6_nbr.c:1.31
natm.c:1.40 if_dc.c:1.162 if_de.c:1.168 if_pcn.c:1.72 if_rl.c:1.154
if_sf.c:1.84 if_sis.c:1.135 if_sk.c:1.108 if_ste.c:1.86 if_ti.c:1.109
if_tl.c:1.101 if_vr.c:1.106 if_wb.c:1.81 if_xl.c:1.194 from HEAD to
RELENG_6:

  Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
  IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
  ifnet.if_drv_flags.  Device drivers are now responsible for
  synchronizing access to these flags, as they are in if_drv_flags.  This
  helps prevent races between the network stack and device driver in
  maintaining the interface flags field.

  Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
  some less so.

  Reviewed by:    pjd, bz

Approved by:	re (scottl)

Revision 1.91.2.1: download - view: text, markup, annotated - select for diffs
Wed Aug 24 16:50:36 2005 UTC (6 years, 5 months ago) by rwatson
Branches: RELENG_6
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +2 -0 lines
Merge if_ath.c:1.99 awi.c:1.39 if_bfe.c:1.26 if_bge.c:1.92 if_ed.c:1.255
if_em.c:1.67 if_ex.c:1.57 if_fe.c:1.92 if_fxp.c:1.242 if_gem.c:1.32
if_hme.c:1.38 if_ie.c:1.103 if_ndis.c:1.100 if_ixgb.c:1.12 if_lge.c:1.40
if_lnc.c:1.112 if_my.c:1.30 if_nge.c:1.76 if_nve.c:1.9 if_owi.c:1.11
pdq_ifsubr.c:1.27 if_ray.c:1.80 if_re.c:1.47 if_sn.c:1.47 dp83932.c:1.20
if_tx.c:1.90 if_txp.c:1.32 if_aue.c:1.91 if_axe.c:1.31 if_cue.c:1.58
if_kue.c:1.65 if_rue.c:1.22 if_udav.c:1.15 if_vge.c:1.15 if_wi.c:1.182
if_wl.c:1.67 if_xe.c:1.58 if_dc.c:1.161 if_de.c:1.167 if_pcn.c:1.70
if_rl.c:1.153 if_sf.c:1.83 if_sis.c:1.134 if_sk.c:1.107 if_ste.c:1.85
if_ti.c:1.108 if_tl.c:1.100 if_vr.c:1.105 if_wb.c:1.80 if_xl.c:1.193
from HEAD to RELENG_6:

  Modify device drivers supporting multicast addresses to lock if_addr_mtx
  over iteration of their multicast address lists when synchronizing the
  hardware address filter with the network stack-maintained list.

  Problem reported by:    Ed Maste (emaste at phaedrus dot sandvine dot ca>

Approved by:	re (scottl)

Revision 1.93: download - view: text, markup, annotated - select for diffs
Tue Aug 9 10:19:44 2005 UTC (6 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +16 -15 lines
Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags.  Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags.  This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.

Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.

Reviewed by:	pjd, bz
MFC after:	7 days

Revision 1.92: download - view: text, markup, annotated - select for diffs
Wed Aug 3 00:18:29 2005 UTC (6 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +2 -0 lines
Modify device drivers supporting multicast addresses to lock if_addr_mtx
over iteration of their multicast address lists when synchronizing the
hardware address filter with the network stack-maintained list.

Problem reported by:	Ed Maste (emaste at phaedrus dot sandvine dot ca>
MFC after:		1 week

Revision 1.72.2.14: download - view: text, markup, annotated - select for diffs
Wed Jul 20 06:04:21 2005 UTC (6 years, 6 months ago) by dwhite
Branches: RELENG_5
Diff to: previous 1.72.2.13: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.13: +21 -0 lines
MFC: Undo 5.4-R bge hacks by default and provide kernel option to override.

Revision 1.3.2.39: download - view: text, markup, annotated - select for diffs
Sun Jul 3 03:41:18 2005 UTC (6 years, 7 months ago) by silby
Branches: RELENG_4
Diff to: previous 1.3.2.38: preferred, colored
Changes since revision 1.3.2.38: +4 -0 lines
MFC PCI Ids for 5751M and 5789 chips - this brings device support
in line with what 6.x and 5.x have.

Requested by:	Juraj Lutter

Revision 1.91: download - view: text, markup, annotated - select for diffs
Fri Jun 24 21:43:46 2005 UTC (6 years, 7 months ago) by dwhite
Branches: MAIN
CVS tags: RELENG_6_BP
Branch point for: RELENG_6
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +21 -0 lines
Backout the change I made before 5.4-R since I wasn't aware that it was only
a problem with one particular switch module.  Create a kernel option
BGE_FAKE_AUTONEG that restores the 5.4 behavior, which should make the DNLK
switch module work. IBM/Intel blades with Intel or AD switch modules should
work without patching or kernel options with this commit.

Hardware for testing provided by several folks, including
Danny Braniss <danny@cs.huji.ac.il>, Achim Patzner <ap@bnc.net>,
and OffMyServer.

Approved by: re

Revision 1.90: download - view: text, markup, annotated - select for diffs
Fri Jun 10 16:49:05 2005 UTC (6 years, 8 months ago) by brooks
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +39 -30 lines
Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
 - Struct arpcom is no longer referenced in normal interface code.
   Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
   To enforce this ac_enaddr has been renamed to _ac_enaddr.
 - The second argument to ether_ifattach is now always the mac address
   from driver private storage rather than sometimes being ac_enaddr.

Reviewed by:	sobomax, sam

Revision 1.3.2.38: download - view: text, markup, annotated - select for diffs
Fri Jun 3 19:14:01 2005 UTC (6 years, 8 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.3.2.37: preferred, colored
Changes since revision 1.3.2.37: +10 -1 lines
MFC support for the 5714

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sun May 29 04:42:18 2005 UTC (6 years, 8 months ago) by nyan
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +0 -1 lines
Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64.  The optimization is a trivial on recent machines.

Reviewed by:	-arch (imp, marcel, dfr)

Revision 1.72.2.13: download - view: text, markup, annotated - select for diffs
Sun May 22 03:17:49 2005 UTC (6 years, 8 months ago) by silby
Branches: RELENG_5
Diff to: previous 1.72.2.12: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.12: +2 -0 lines
MFC: Add PCI ID for BCM5789.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Sun May 22 03:16:45 2005 UTC (6 years, 8 months ago) by silby
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +2 -0 lines
Add PCI ID for BCM5789.

Submitted by:	S. Aeschbacher

Revision 1.72.2.12: download - view: text, markup, annotated - select for diffs
Thu May 19 21:12:04 2005 UTC (6 years, 8 months ago) by ps
Branches: RELENG_5
Diff to: previous 1.72.2.11: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.11: +9 -0 lines
MFC: support for the 5714

Revision 1.87: download - view: text, markup, annotated - select for diffs
Thu May 19 21:08:59 2005 UTC (6 years, 8 months ago) by ps
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +9 -0 lines
Support the 5714C

Submitted by:	John Cagle <john dot cagle at hp dot com>

Revision 1.72.2.10.2.1: download - view: text, markup, annotated - select for diffs
Fri May 6 00:38:51 2005 UTC (6 years, 9 months ago) by dwhite
Branches: RELENG_5_4
CVS tags: RELENG_5_4_0_RELEASE
Diff to: previous 1.72.2.10: preferred, colored; next MAIN 1.72.2.11: preferred, colored
Changes since revision 1.72.2.10: +0 -17 lines
Insta-MFC 1.86:
  Fix link on IBM/Intel blade servers

Approved by:	re

Revision 1.72.2.11: download - view: text, markup, annotated - select for diffs
Fri May 6 00:38:02 2005 UTC (6 years, 9 months ago) by dwhite
Branches: RELENG_5
Diff to: previous 1.72.2.10: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.10: +0 -17 lines
Insta-MFC 1.86:
  Fix 5704S on IBM/Intel blade servers.

Approved by:	re

Revision 1.86: download - view: text, markup, annotated - select for diffs
Thu May 5 03:37:27 2005 UTC (6 years, 9 months ago) by dwhite
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +0 -17 lines
Backout part of rev 1.71, which breaks the interfaces on IBM/Intel blade
servers.

PR:		kern/68445
MFC after:	7 days

Revision 1.85: download - view: text, markup, annotated - select for diffs
Sun Apr 24 02:45:27 2005 UTC (6 years, 9 months ago) by scottl
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +1 -1 lines
Fix the order of the lowaddr,highaddr arguments in the parent tag.  This
coincidentally didn't cause any problems, but was definitely wrong.

Revision 1.72.2.10: download - view: text, markup, annotated - select for diffs
Tue Mar 22 14:12:31 2005 UTC (6 years, 10 months ago) by avatar
Branches: RELENG_5
CVS tags: RELENG_5_4_BP
Branch point for: RELENG_5_4
Diff to: previous 1.72.2.9: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.9: +2 -0 lines
MFC: (1.84) Adding new device ID for BCM5751M support.

Reviewed by:	sam (mentor)
Approved by:	re (kensmith)

Revision 1.84: download - view: text, markup, annotated - select for diffs
Sat Mar 12 06:51:25 2005 UTC (6 years, 11 months ago) by avatar
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +2 -0 lines
Adding new device ID for BCM5751M support.

Submitted by:	FUJITA Kazutoshi <fujita at soum dot co dot jp>
Reviewed by:	sam (mentor)

Revision 1.72.2.9: download - view: text, markup, annotated - select for diffs
Wed Mar 2 20:29:33 2005 UTC (6 years, 11 months ago) by obrien
Branches: RELENG_5
Diff to: previous 1.72.2.8: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.8: +2 -2 lines
MFC: rev 1.81: Don't force busdma to pre-allocate bounce pages for the parent tag.

Reviewed by:	scottl

Revision 1.72.2.8: download - view: text, markup, annotated - select for diffs
Wed Mar 2 10:07:32 2005 UTC (6 years, 11 months ago) by obrien
Branches: RELENG_5
Diff to: previous 1.72.2.7: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.7: +8 -2 lines
MFC: rev 1.79: initiate a transmit only if packets were added to the tx chain.

Revision 1.72.2.7: download - view: text, markup, annotated - select for diffs
Wed Mar 2 10:01:54 2005 UTC (6 years, 11 months ago) by obrien
Branches: RELENG_5
Diff to: previous 1.72.2.6: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.6: +51 -51 lines
style(9) sync with HEAD

Revision 1.72.2.6: download - view: text, markup, annotated - select for diffs
Sun Jan 30 00:59:30 2005 UTC (7 years ago) by imp
Branches: RELENG_5
Diff to: previous 1.72.2.5: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.5: +1 -1 lines
MFC: /*- and my license changes for sys/[a-d]*

Revision 1.72.2.5: download - view: text, markup, annotated - select for diffs
Sat Jan 29 23:34:55 2005 UTC (7 years ago) by rwatson
Branches: RELENG_5
Diff to: previous 1.72.2.4: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.4: +6 -3 lines
Merge if_bge.c:1.80 from HEAD to RELENG_5:

  date: 2004/11/08 19:27:00;  author: phk;  state: Exp;  lines: +7 -5
  Hide link up/down/media printfs behind bootverbose

Revision 1.83: download - view: text, markup, annotated - select for diffs
Thu Jan 6 01:42:30 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +1 -1 lines
Start each of the license/copyright comments with /*-, minor shuffle of lines

Revision 1.3.2.36.2.1: download - view: text, markup, annotated - select for diffs
Mon Dec 20 18:58:15 2004 UTC (7 years, 1 month ago) by ps
Branches: RELENG_4_11
CVS tags: RELENG_4_11_0_RELEASE
Diff to: previous 1.3.2.36: preferred, colored; next MAIN 1.3.2.37: preferred, colored
Changes since revision 1.3.2.36: +2 -0 lines
MFC: 5721 Support

Approved by:	re

Revision 1.3.2.37: download - view: text, markup, annotated - select for diffs
Mon Dec 20 18:55:02 2004 UTC (7 years, 1 month ago) by ps
Branches: RELENG_4
Diff to: previous 1.3.2.36: preferred, colored
Changes since revision 1.3.2.36: +2 -0 lines
MFC: 5721 Support

Approved by:	re

Revision 1.72.2.4: download - view: text, markup, annotated - select for diffs
Fri Dec 17 21:51:45 2004 UTC (7 years, 1 month ago) by ps
Branches: RELENG_5
Diff to: previous 1.72.2.3: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.3: +2 -0 lines
MFC: Support the 5721

Revision 1.82: download - view: text, markup, annotated - select for diffs
Fri Dec 17 21:50:18 2004 UTC (7 years, 1 month ago) by ps
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +2 -0 lines
Add support for the 5721 which seems to be similar to the 5750/5751.

Tested by:	Vivek Khera vivek at khera dot org

Revision 1.81: download - view: text, markup, annotated - select for diffs
Sun Nov 21 04:02:36 2004 UTC (7 years, 2 months ago) by scottl
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +2 -2 lines
Don't force busdma to pre-allocate bounce pages for the parent tag.

Revision 1.3.2.36: download - view: text, markup, annotated - select for diffs
Tue Nov 16 19:32:15 2004 UTC (7 years, 2 months ago) by ps
Branches: RELENG_4
CVS tags: RELENG_4_11_BP
Branch point for: RELENG_4_11
Diff to: previous 1.3.2.35: preferred, colored
Changes since revision 1.3.2.35: +126 -29 lines
MFC: Support for the 5750/5751

Revision 1.72.2.3: download - view: text, markup, annotated - select for diffs
Sun Nov 14 03:48:34 2004 UTC (7 years, 2 months ago) by scottl
Branches: RELENG_5
Diff to: previous 1.72.2.2: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.2: +2 -2 lines
MFC rev 1.76: Use an alignment of 1 instead of ETHER_ALIGN for busdma.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Mon Nov 8 19:27:00 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +7 -5 lines
Hide link up/down/media printfs behind bootverbose

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sat Oct 30 22:59:30 2004 UTC (7 years, 3 months ago) by des
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +7 -0 lines
With ALTQ, it is possible that although the queue was not empty when we
entered the interface start function, no packets were actually dequeued.
Therefore, keep a count of how many packets we really added onto the tx
chain, and initiate a transmit only if the count is non-zero.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Sat Oct 30 21:21:10 2004 UTC (7 years, 3 months ago) by des
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +10 -8 lines
Add altq(4) support.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Sat Oct 30 14:54:51 2004 UTC (7 years, 3 months ago) by des
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +51 -51 lines
Whitespace cleanup.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Tue Oct 19 02:42:49 2004 UTC (7 years, 3 months ago) by scottl
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +2 -2 lines
Use and alignment of 1 instead of ETHER_ALIGN for rx and tx buffers and jumbo
frames.  BGE hardware with the rx alignment bug will still be handled by the
calls to m_adj() that already exist.  m_adj() is probably better suited for
this task anyways.  Just as with if_em, this saves a malloc + several locks
per packet and prevents unneeded data copying within busdma.

Revision 1.72.2.2: download - view: text, markup, annotated - select for diffs
Wed Sep 29 14:31:49 2004 UTC (7 years, 4 months ago) by ps
Branches: RELENG_5
CVS tags: RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Diff to: previous 1.72.2.1: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.1: +121 -38 lines
MFC: Add support for the 5750/5751

Approved by:	re

Revision 1.72.2.1: download - view: text, markup, annotated - select for diffs
Wed Sep 29 14:29:48 2004 UTC (7 years, 4 months ago) by ps
Branches: RELENG_5
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +11 -2 lines
MFC: rev 1.73 supress spurious link change events.

Approved by:	re

Revision 1.75: download - view: text, markup, annotated - select for diffs
Sat Sep 25 05:07:20 2004 UTC (7 years, 4 months ago) by ps
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +20 -20 lines
Fix the statements for checking if we're dealing with a 5705/5750.

Pointhat to:	me

Revision 1.74: download - view: text, markup, annotated - select for diffs
Fri Sep 24 22:24:33 2004 UTC (7 years, 4 months ago) by ps
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +121 -38 lines
Add support for the BCM5750/5751.  Unfortunately the documentation
I have from Broadcom does not give much information on these devices,
so the Broadcom Linux driver was used for clues to what these chips
support.  It turns out they are similar to the 5705 with the 5751
being the PCI-Express version and needing special work-arounds and
settings.

Revision 1.3.2.35: download - view: text, markup, annotated - select for diffs
Thu Sep 23 20:11:18 2004 UTC (7 years, 4 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.3.2.34: preferred, colored
Changes since revision 1.3.2.34: +33 -0 lines
MFC: Add some special case code to fix a problem with the BCM5704
in TBI (fiber) mode.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Fri Sep 17 04:58:17 2004 UTC (7 years, 4 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +11 -2 lines
Commit patch to supress spurious link change events. Apparently, with
copper NICs, a link change event is posted whenever MII autopolling is
toggled off and on, which happens whenever someone calls
bge_miibus_readreg() or bge_miibus_writereg() to access the PHY
registers. This means anytime someone called the SIOCGIFMEDIA ioctl
on a bge interface, the link would reset. Even a simple "ifconfig bge0"
would do it, though other apps like dhclient or the PPPoE daemon could
trigger it as well. An obvious symptom of this problem is lots of
"bgeX: gigabit link up" messages appearing on the console for no
apparent reason.

Through experimentation, I determined that when a real link change
event occurs, the BGE_MIMODE_AUTOPOLL in the BGE_MI_MODE register
is always set, so now if we have a copper NIC and an link change
event occurs and the BGE_MIMODE_AUTOPOLL bit is clear, we ignore
the event.

Note that this does not apply to the original BCM5700 chip since we
use a different method for sensing link changes with that chip (the
status block method was broken), nor to fiber optic NICs since they
don't use the GMII PHY access registers.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Sat Jul 24 13:45:38 2004 UTC (7 years, 6 months ago) by yar
Branches: MAIN
CVS tags: RELENG_5_BP
Branch point for: RELENG_5
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +14 -6 lines
Bring the advertised interface capabilities into line with the reality
(in particular, bge(4) hasn't supported rxcsum since if_bge.c#1.5)

Clean up some aspects of capabilities usage, i.e. stop using
if_hwassist to see whether we are doing offload now because if_hwassist
is for TCP/IP layer and it is subordinate to if_capenable.

Thanks to:	Aled Morris for donating a nice bge(4) NIC to me
Reviewed by:	-net, -hackers (silence)

Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed Jun 9 16:01:59 2004 UTC (7 years, 8 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +33 -0 lines
Add some special case code to fix a problem with the BCM5704 in TBI (fiber)
mode. The 5704 apparently has some s00p3r s33kr1t registers for setting
the advertisement of pause frame ability (i.e flow control) when in
autoneg mode. If we don't set these registers correctly, we may not
be able to negotiate a proper link with some switches. (Symptom is that
the NIC reports the link as up (PCS synched) but no traffic can be
exchanged.)

PR:		kern/67598

Revision 1.70: download - view: text, markup, annotated - select for diffs
Wed Jun 9 14:33:58 2004 UTC (7 years, 8 months ago) by naddy
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +2 -23 lines
Replace handrolled CRC calculation with ether_crc32_[lb]e().

Revision 1.69: download - view: text, markup, annotated - select for diffs
Sun May 30 20:08:27 2004 UTC (7 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +1 -0 lines
Add missing <sys/module.h> includes

Revision 1.3.2.34: download - view: text, markup, annotated - select for diffs
Mon May 24 04:53:08 2004 UTC (7 years, 8 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.3.2.33: preferred, colored
Changes since revision 1.3.2.33: +2 -0 lines
MFC: support for the BCM5705K

Revision 1.68: download - view: text, markup, annotated - select for diffs
Mon May 24 04:46:54 2004 UTC (7 years, 8 months ago) by ps
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +2 -0 lines
Add support for BCM5705K

Submitted by:	candy@kgc.co.jp
PR:		kern/67110

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sun May 23 16:11:45 2004 UTC (7 years, 8 months ago) by mux
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +0 -1 lines
We don't need to initialize if_output, ether_ifattach() does it
for us.

Revision 1.3.2.32.2.1: download - view: text, markup, annotated - select for diffs
Thu May 6 01:55:21 2004 UTC (7 years, 9 months ago) by jdp
Branches: RELENG_4_10
CVS tags: RELENG_4_10_0_RELEASE
Diff to: previous 1.3.2.32: preferred, colored; next MAIN 1.3.2.33: preferred, colored
Changes since revision 1.3.2.32: +5 -7 lines
Merge from RELENG_4: Atomically load and clear the bge status block.

Approved by:	re (scottl)

Revision 1.3.2.33: download - view: text, markup, annotated - select for diffs
Mon May 3 20:32:32 2004 UTC (7 years, 9 months ago) by jdp
Branches: RELENG_4
Diff to: previous 1.3.2.32: preferred, colored
Changes since revision 1.3.2.32: +5 -7 lines
MFC part of if_bge.c revision 1.41: atomically load and clear the
status block.  This makes the bge devices work much better when
interrupts are shared.

This change entails bringing in the atomic_readandclear_* functions
from -current.  RELENG_4 already had the equivalent loadandclear
function for the i386, but it did not exist for the alpha.

Revision 1.3.2.32: download - view: text, markup, annotated - select for diffs
Tue Apr 6 22:53:00 2004 UTC (7 years, 10 months ago) by ps
Branches: RELENG_4
CVS tags: RELENG_4_10_BP
Branch point for: RELENG_4_10
Diff to: previous 1.3.2.31: preferred, colored
Changes since revision 1.3.2.31: +8 -0 lines
MFC:
Add support for the Altima 1002, BCM5901, BCM5901 rev A2 and BCM5788.

Revision 1.3.2.31: download - view: text, markup, annotated - select for diffs
Tue Apr 6 18:30:05 2004 UTC (7 years, 10 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.3.2.30: preferred, colored
Changes since revision 1.3.2.30: +4 -4 lines
MFC: rev 1.66
Enable the memory arbiter before turning off the PXE restart.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Tue Apr 6 18:28:15 2004 UTC (7 years, 10 months ago) by ps
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +4 -4 lines
Enable the memory arbiter before turning off the PXE restart.  This
prevents NMI's from happening when resetting the chip on some
hardware I have seen.

Mis-behaving box made available by:	John Cagle <john.cagle@hp.com>

Revision 1.65: download - view: text, markup, annotated - select for diffs
Wed Mar 17 17:50:28 2004 UTC (7 years, 10 months ago) by njl
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +3 -3 lines
Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde

Revision 1.64: download - view: text, markup, annotated - select for diffs
Sun Mar 14 07:12:20 2004 UTC (7 years, 10 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +0 -6 lines
Announce ethernet MAC addresss in ether_ifattach().

Revision 1.3.2.30: download - view: text, markup, annotated - select for diffs
Tue Jan 13 11:32:44 2004 UTC (8 years ago) by brueffer
Branches: RELENG_4
Diff to: previous 1.3.2.29: preferred, colored
Changes since revision 1.3.2.29: +1 -1 lines
MFC: 1.63

Fix typo in a comment

Revision 1.63: download - view: text, markup, annotated - select for diffs
Tue Jan 13 11:31:09 2004 UTC (8 years ago) by brueffer
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +1 -1 lines
Fix typo in a comment

Revision 1.62: download - view: text, markup, annotated - select for diffs
Thu Jan 8 17:19:11 2004 UTC (8 years, 1 month ago) by wpaul
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +2 -0 lines
Add the PCI ID for yet another bge chip: the Altima 1002.

Submitted by: Pavel Gubin <pg@rainbow.ie.tusur.ru>

Revision 1.61: download - view: text, markup, annotated - select for diffs
Mon Dec 8 07:54:12 2003 UTC (8 years, 2 months ago) by obrien
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +5 -5 lines
Don't use caddr_t in mchash().  Also use C99 spellings over BSD ones.

Requested by:	bde,imp

Revision 1.3.2.29: download - view: text, markup, annotated - select for diffs
Mon Dec 1 21:06:59 2003 UTC (8 years, 2 months ago) by ambrisko
Branches: RELENG_4
Diff to: previous 1.3.2.28: preferred, colored
Changes since revision 1.3.2.28: +2 -0 lines
MFC:	Dell 2650 no link led problem.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Fri Nov 14 17:16:56 2003 UTC (8 years, 2 months ago) by obrien
Branches: MAIN
CVS tags: RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +0 -3 lines
Remove duplicate FBSDID's, move others to their right place.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Thu Nov 13 20:55:47 2003 UTC (8 years, 2 months ago) by obrien
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +6 -4 lines
Try to create some sort of consistency in how the routings to find the
multicast hash are written.  There are still two distinct algorithms used,
and there actually isn't any reason each driver should have its own copy
of this function as they could all share one copy of it (if it grew an
additional argument).

Revision 1.58: download - view: text, markup, annotated - select for diffs
Tue Nov 11 17:57:03 2003 UTC (8 years, 3 months ago) by sam
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +106 -60 lines
o add locking
o mark isr MPSAFE

Supported by:	FreeBSD Foundation

Revision 1.57: download - view: text, markup, annotated - select for diffs
Fri Oct 31 18:31:57 2003 UTC (8 years, 3 months ago) by brooks
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +1 -2 lines
Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)

Revision 1.56: download - view: text, markup, annotated - select for diffs
Fri Oct 31 16:25:39 2003 UTC (8 years, 3 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +2 -0 lines
Add support for the Broadcom BCM5788 (just another entry to the PCI
device ID list, probably a 5705 ASIC).

Submitted by: Marcel Prisi <marcel@virtua.ch>

Revision 1.3.2.28: download - view: text, markup, annotated - select for diffs
Fri Sep 26 16:02:04 2003 UTC (8 years, 4 months ago) by ps
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9
Diff to: previous 1.3.2.27: preferred, colored
Changes since revision 1.3.2.27: +1 -1 lines
MFC rev 1.55
By not setting No_CRC in the Mode Control Register, we must also
reduce the size of the packet by 4 bytes to remove the ethernet crc.

Approved by:	re

Revision 1.55: download - view: text, markup, annotated - select for diffs
Tue Sep 23 19:54:32 2003 UTC (8 years, 4 months ago) by ps
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +1 -1 lines
By not setting No_CRC in the Mode Control Register, we must also
reduce the size of the packet by 4 bytes to remove the ethernet crc.

Submitted by:	jdp

Revision 1.3.2.27: download - view: text, markup, annotated - select for diffs
Tue Sep 23 02:34:49 2003 UTC (8 years, 4 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.3.2.26: preferred, colored
Changes since revision 1.3.2.26: +1 -2 lines
MFC: rev 1.54, Do not set the No_CRC bit in the Mode Control Register.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Tue Sep 23 00:37:07 2003 UTC (8 years, 4 months ago) by ps
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +1 -2 lines
From the Broadcom Eratta:
Setting the No_CRC bit Can Cause Data Write Errors on BCM5701/03/04
The resolution is to not set the No_CRC bit in the Mode Control Register.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sun Aug 24 17:46:01 2003 UTC (8 years, 5 months ago) by obrien
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +3 -0 lines
Use __FBSDID().
Also some minor style cleanups.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Fri Aug 22 05:51:26 2003 UTC (8 years, 5 months ago) by imp
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +2 -2 lines
Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Wed Aug 20 04:06:00 2003 UTC (8 years, 5 months ago) by ambrisko
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +2 -0 lines
On Dell boxes such as the PE2650 we need to disable 3 led mode for the
link LED to work.

Reviewed by:	wpaul
Obtained from:	Linux driver

Revision 1.3.2.26: download - view: text, markup, annotated - select for diffs
Sun Aug 17 19:15:10 2003 UTC (8 years, 5 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.3.2.25: preferred, colored
Changes since revision 1.3.2.25: +0 -0 lines
MFC: BGE_HCC_TX_MAX_COAL_BDS_INT is at offset 0x3C24, not 0x3C34

Revision 1.50: download - view: text, markup, annotated - select for diffs
Tue Aug 12 05:18:51 2003 UTC (8 years, 6 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +4 -0 lines
Add support for the Broadcom BCM5901 and BCM5901 rev A2 chips.
These are 10/100 only NICs found on the IBM Thinkpad R40E and
G40. These seem to be based on the BCM5705 MAC but with a PHY
that doesn't support 1000Mbps modes.

Submitted by:	Igor Sviridov <sia@nest.org>

Revision 1.3.2.25: download - view: text, markup, annotated - select for diffs
Sun Aug 10 18:08:49 2003 UTC (8 years, 6 months ago) by wpaul
Branches: RELENG_4
Diff to: previous 1.3.2.24: preferred, colored
Changes since revision 1.3.2.24: +12 -3 lines
MFC: properly set mbuf space size for the BCM5704 NICs to fix watchdog
timeouts on Dell 1750 servers, and fix spurious 'gigabit link up'
messages due to not ignoring the 'MI_COMPLETE' bit in the MAC
status register. (I'm MFCing these fairly quickly since they're
fixes for pretty serious/annoying bugs.)

Revision 1.49: download - view: text, markup, annotated - select for diffs
Sun Aug 10 18:04:35 2003 UTC (8 years, 6 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +10 -2 lines
The BCM5704 ASIC has a smaller mbuf space than the 5700/1/2/3. Failure
to configure this correctly yields many watchdog timeouts even on lightly
loaded machines. This is a common complaint from users with Dell 1750
servers with built-in dual 5704 NICs.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Sun Aug 10 01:32:16 2003 UTC (8 years, 6 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +2 -1 lines
Silence unwanted 'gigabit link up' messages: do not treat the
BGE_MACSTAT_MI_COMPLETE bit in the MAC status register as a link
change indicator. We turn this bit on now because some of the newer
chips need it, but it usually just means that reading/writing
an MII/GMII register has completed, not that a link change has
occured.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Mon Aug 4 05:50:53 2003 UTC (8 years, 6 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +1 -1 lines
Set the BGE_RX_MTU register correctly so that we can receive slightly
larger than normal frames, to account for the case where a bge(4) NIC
is used with VLANs. Since we set the IFCAP_VLAN_MTU flag, we must allow
reception of frames up to 1522 bytes in size rather than 1518.

Note that it is possible to work around this bug by doing:

# ifconfig bge0 mtu 1504

prior to configuring any VLAN interfaces.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Fri Jul 25 20:33:43 2003 UTC (8 years, 6 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +0 -2 lines
Remove alpha vtophys() hack from if_bgereg.h and clean up unneeded
#includes formerly required to pull in vtophys support, since we
don't need them anymore.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Fri Jul 25 19:42:43 2003 UTC (8 years, 6 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +798 -122 lines
Convert bge(4) to use busdma. I have not tested this on anything
besides x86 yet since I don't have access to a non-x86 FreeBSD
box at the moment. Volunteers welcome.

Revision 1.3.2.24: download - view: text, markup, annotated - select for diffs
Tue Jul 22 02:12:54 2003 UTC (8 years, 6 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.3.2.23: preferred, colored
Changes since revision 1.3.2.23: +233 -112 lines
MFC: support for the Broadcom 5705

Revision 1.44: download - view: text, markup, annotated - select for diffs
Wed Jul 16 00:09:56 2003 UTC (8 years, 6 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +226 -103 lines
Add support for the BCM5705 and its ilk. Changes:

- 5705 doesn't support jumbo frames
- Statistics must be read from registers
- RX return ring must be capped at 512 entries
- Omit initialization of certain device blocks
- Acknowledge link change interrupts by setting the 'link changed'
  bit in the status register (used to have no effect)
- Remember to toggle the MI completion bit too
- Set the mbuf low watermark differently (on-chip memory buffers,
  not BSD mbufs)
- Don't enable Ethernet@WireSpeed feature for certain 5705 chip revs
- Add additional PCI IDs for 5705 and 5782 parts
- Add a forgotten 5704 PCI ID

Most changes ripped kicking and screaming from the Broadcom linux driver.
Thanks to Paul Saab for sanity testing. (My lack of sanity has been
confirmed.)

Revision 1.3.2.23: download - view: text, markup, annotated - select for diffs
Sat Jul 12 21:00:50 2003 UTC (8 years, 7 months ago) by wpaul
Branches: RELENG_4
Diff to: previous 1.3.2.22: preferred, colored
Changes since revision 1.3.2.22: +23 -6 lines
MFC: try to distinguish PCS encoding error events from actual link state
change events.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Fri Jul 11 08:19:52 2003 UTC (8 years, 7 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +19 -4 lines
Squelch spurious "gigabit link up" messages generated on some fiber NICs
(mainly the 3Com 3c996B/BCM5701).

For some reason that I don't fully understand, the 5701 signals PCS
encoding errors as though they were link change events, i.e. the 'link
state changed' bit in the status word of the status block is updated
and an interrupt is generated. This would cause the bge_tick() function
to be invoked and a "gigabit link up" message to be printed on the console.

To avoid this, the interrupt handler now checks the MAC status register
when a link change interrupt is triggered, and it will only call the
bge_tick() function if the 'PCS encoding error detected' bit is clear.
(This change should have no effect on copper NICs since this bit can
only ever be set in TBI mode. I do not know how it affects 5704 NICs
with a BCM8002 SERDES PHY.)

Special thanks to: Sherry Rogers at UCB for allowing me access to one
of their traffic monitor boxes so I could diagnose this problem.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Sat May 31 20:42:24 2003 UTC (8 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +0 -2 lines
Remove unused variable(s).

Found by:       FlexeLint

Revision 1.41: download - view: text, markup, annotated - select for diffs
Wed May 21 07:00:49 2003 UTC (8 years, 8 months ago) by ps
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +15 -17 lines
- Make this work with PAE.
- atomically load and clear the status block so we dont miss an
  update.
  Submitted by: jdp

Approved by:	re (scottl)

Revision 1.3.2.22: download - view: text, markup, annotated - select for diffs
Sun May 11 18:00:55 2003 UTC (8 years, 9 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.3.2.21: preferred, colored
Changes since revision 1.3.2.21: +100 -70 lines
MFC:
if_bge.c:
- Support for the 5704
- Write twice to send producer index workaround
- Leave LED set to hardware default
- ONEDMA_AT_ONCE workaround
- Disable AUTOPOLL when accessing the PHY
- Check the UPDATED bit in the status block

brgphy.c:
- Support for the 5704
- Loop the phy when changing media types
- For 1000BaseT operation, autonegotiation must be enabled
- DSP patches

Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed May 7 21:51:13 2003 UTC (8 years, 9 months ago) by ps
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +22 -23 lines
- Change the full Asic revision defines to CHIPID to better since the
  ASIC revision is really the major number of the CHIPID.  Also store
  the chipid, asic rev and chip revision in the softc for later use.

- The write twice to send producer index workaround only applies to
  the 5700_BX chips, so only do it there.
  Requested by: jdp

- Do not initalize the LED's to 0x00.  The default configuration
  the chip comes up in should yeild proper operation of the LED's.
  Confirmed by: John Cagle <john.cagle@hp.com>

Approved by:	re (blanket)

Revision 1.39: download - view: text, markup, annotated - select for diffs
Sun May 4 00:07:21 2003 UTC (8 years, 9 months ago) by ps
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +11 -0 lines
Implement the write twice to send producer index workaround for
BCM5700 chips as described in the Broadcom Errata documents.

Obtained from:	NetBSD and Broadcom Errata documentation

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sat May 3 22:58:45 2003 UTC (8 years, 9 months ago) by ps
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +38 -10 lines
- Change the short hand representation of the various ASIC revisions
- Implement the ONEDMA_AT_ONCE workaround as described in the
  5703/5704 eratta documents.
  Obtained from: NetBSD & Broadcom documentation

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sat May 3 19:06:50 2003 UTC (8 years, 9 months ago) by ps
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +37 -50 lines
- Move bge_phy_hack into the phy code and implement the various DSP
  patch workarounds for each phy revision.
  Obtained from: NetBSD & Broadcom Linux driver

- Disable AUTOPOLL when accessing the PHY as it may cause PCI errors.
  Obtained from: NetBSD

- Check the UPDATED bit in the status block so the driver knows
  that the status block as indeed changed since the last access.
  Broadcom documentation states drivers should unset the UPDATED/CHANGED
  bits after reading them.

- When changing media types, first loop the phy then set the media.
  Broadcom documentation and Linux drivers do this and I observed
  much better handling of link after this change.

- Broadcom documentation states that for 1000BaseT operation,
  autonegotiation must be enabled.  Fix hard coding of media so that
  the driver only advertises 1000BaseT as the supported media type
  and enable autonegotition.

- Only set Master/Slave on the 5701.
  Obtained from Broadcom Linux driver.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Fri May 2 19:53:40 2003 UTC (8 years, 9 months ago) by ps
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +5 -0 lines
Add untested support for the Broadcom 5704.

Obtained from:	NetBSD

Revision 1.3.2.21: download - view: text, markup, annotated - select for diffs
Tue Apr 29 18:40:44 2003 UTC (8 years, 9 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.3.2.20: preferred, colored
Changes since revision 1.3.2.20: +3 -3 lines
MFC: rev 1.35. Update the mbuf watermark settings.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sat Apr 26 18:26:29 2003 UTC (8 years, 9 months ago) by ps
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +3 -3 lines
Update the mbuf watermark settings to match the latest documentation
from Broadcom.  These values are strongly encouraged for proper operation.

MFC after:	3 days

Revision 1.34: download - view: text, markup, annotated - select for diffs
Wed Apr 16 03:16:53 2003 UTC (8 years, 9 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +0 -9 lines
- Don't call pci_enable_io() in drivers (unless needed for resume).
- Don't test memory/port status and emit an error message; the PCI
  bus code will do this now.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Tue Apr 15 06:37:21 2003 UTC (8 years, 9 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +3 -1 lines
- Express hard dependencies on bus (pci, isa, pccard) and
  network layer (ether).
- Don't abuse module names to facilitate ifconfig module loading;
  such abuse isn't really needed.  (And if we do need type information
  associated with a module then we should make it explicit and not
  use hacks.)

Revision 1.32: download - view: text, markup, annotated - select for diffs
Thu Apr 3 21:36:30 2003 UTC (8 years, 10 months ago) by obrien
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +4 -13 lines
Use __FBSDID rather than rcsid[].

Revision 1.31: download - view: text, markup, annotated - select for diffs
Wed Feb 19 05:47:01 2003 UTC (8 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +3 -3 lines
Back out M_* changes, per decision of the TRB.

Approved by: trb

Revision 1.3.2.20: download - view: text, markup, annotated - select for diffs
Thu Feb 6 21:36:40 2003 UTC (9 years ago) by ps
Branches: RELENG_4
CVS tags: RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8
Diff to: previous 1.3.2.19: preferred, colored
Changes since revision 1.3.2.19: +15 -7 lines
MFC: rev 1.30 Read the media type from shared memory.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Wed Feb 5 08:54:36 2003 UTC (9 years ago) by ps
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +15 -7 lines
Obtain the media type from the shared memory and only use the eeprom
as a fallback.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Tue Jan 21 08:55:26 2003 UTC (9 years ago) by alfred
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +3 -3 lines
Remove M_TRYWAIT/M_WAITOK/M_WAIT.  Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Sun Jan 19 02:59:31 2003 UTC (9 years ago) by obrien
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +1 -1 lines
Remove miidevs.h and generate it from miidevs at compile time.
The devlist2h.awk tool to do this has been repocopied to sys/tools/.

Revision 1.3.2.19: download - view: text, markup, annotated - select for diffs
Thu Jan 9 18:15:50 2003 UTC (9 years, 1 month ago) by jdp
Branches: RELENG_4
Diff to: previous 1.3.2.18: preferred, colored
Changes since revision 1.3.2.18: +52 -48 lines
MFC:  Avoid 16-bit accesses to device memory.  Use volatile where
appropriate in referencing device memory.  Parenthesize BGE_HOSTADDR
define properly.  Add the ASIC revision to the device description
string that appears in the dmesg output.

This merges in the following revisions from -current:

    if_bge.c		1.26 and 1.27
    if_bgereg.h		1.12

Revision 1.25.2.1: download - view: text, markup, annotated - select for diffs
Wed Jan 8 01:38:37 2003 UTC (9 years, 1 month ago) by jdp
Branches: RELENG_5_0
CVS tags: RELENG_5_0_0_RELEASE
Diff to: previous 1.25: preferred, colored; next MAIN 1.26: preferred, colored
Changes since revision 1.25: +52 -48 lines
MFC:  Avoid 16-bit accesses to device memory.  Use volatile where
appropriate in referencing device memory.  Parenthesize BGE_HOSTADDR
define properly.  Add the ASIC revision to the device description
string that appears in the dmesg output.

This merges in the following revisions from -current:

    if_bge.c		1.26 and 1.27
    if_bgereg.h		1.12

Approved by:	scottl

Revision 1.27: download - view: text, markup, annotated - select for diffs
Tue Jan 7 01:33:03 2003 UTC (9 years, 1 month ago) by jdp
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +10 -1 lines
Put the ASIC revision into the device description string so it appears
in the dmesg output.

MFC after:	3 days

Revision 1.26: download - view: text, markup, annotated - select for diffs
Mon Jan 6 23:46:46 2003 UTC (9 years, 1 month ago) by jdp
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +42 -47 lines
Don't reference the maxlen and flags fields in the ring control blocks
as separate 16-bit entities.  Some of the ring control blocks are
in NIC memory, so they must be referenced using 32-bit accesses.
Smaller accesses have been observed to fail under some conditions.
This caused the rings to be set up wrong, leading to writes by the
card outside of the intended bounds of the rings.  This problem was
diagnosed by Michael Barthelow.  Don Bowman submitted a patch which
fixed the problem using a slightly different approach.

Reference ring control blocks in NIC memory using a pointer to
volatile.

Parenthesize the BGE_HOSTADDR macro definition properly.

MFC after:	3 days

Revision 1.25: download - view: text, markup, annotated - select for diffs
Thu Nov 14 23:54:49 2002 UTC (9 years, 2 months ago) by sam
Branches: MAIN
CVS tags: RELENG_5_0_BP
Branch point for: RELENG_5_0
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +15 -29 lines
network interface driver changes:

o don't strip the Ethernet header from inbound packets; pass packets
  up the stack intact (required significant changes to some drivers)
o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN)
o track ether_ifattach/ether_ifdetach API changes
o track bpf changes (use BPF_TAP and BPF_MTAP)
o track vlan changes (ifnet capabilities, revised processing scheme, etc.)
o use if_input to pass packets "up"
o call ether_ioctl for default handling of ioctls

Reviewed by:	many
Approved by:	re

Revision 1.3.2.18: download - view: text, markup, annotated - select for diffs
Sat Nov 2 18:22:23 2002 UTC (9 years, 3 months ago) by mp
Branches: RELENG_4
Diff to: previous 1.3.2.17: preferred, colored
Changes since revision 1.3.2.17: +5 -47 lines
MFC:
  v1.21: Follow the lead of recent changes in the 3com Linux driver by
  disabling memory write invalidate unconditionally.  It looks like
  they've decided that MWI just doesn't work with these devices.
  Also, remove now-irrelevant code that set PCI write boundary values
  based on the cache line size.

  v1.22: Fix a couple of longstanding typos which would have made a
  statement fail to compile if it weren't inside "#ifdef
  __brokenalpha__".

Approved by:	jdp

Revision 1.3.2.17: download - view: text, markup, annotated - select for diffs
Sat Nov 2 18:17:55 2002 UTC (9 years, 3 months ago) by mp
Branches: RELENG_4
Diff to: previous 1.3.2.16: preferred, colored
Changes since revision 1.3.2.16: +19 -3 lines
MFC: Add support for the BCM5703x chips.  I do not have one of these
cards to test; however the submitter reports that this patch works
with the on-board interface on the IBM x235 server.

Approved by:	jdp

Revision 1.24: download - view: text, markup, annotated - select for diffs
Fri Oct 11 17:18:54 2002 UTC (9 years, 4 months ago) by mjacob
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +1 -17 lines
Fix the code so that it no longer on alpha refers to the now nonexistent
pci_cvt_to_bwx.

This doesn't necessarily make bge(4) now actually *work* on an alpha.
It loads, configures, and then about 30 seconds later, my XP1000 hard
freezes. But, hey, it's a start.

Obtained from:	gallatin@freebsd.org

Revision 1.3.2.16: download - view: text, markup, annotated - select for diffs
Thu Oct 10 16:02:33 2002 UTC (9 years, 4 months ago) by iwasaki
Branches: RELENG_4
Diff to: previous 1.3.2.15: preferred, colored
Changes since revision 1.3.2.15: +2 -0 lines
MFC:
    src/sys/dev/bge if_bge.c (1.23)
    src/sys/dev/bge if_bgereg.h (1.8)

Add support for the BCM5702x chips.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Sat Sep 28 18:04:12 2002 UTC (9 years, 4 months ago) by iwasaki
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +2 -0 lines
Add support for the BCM5702x chips.

Reviewed by:	jdp
MFC after:	1 week

Revision 1.3.2.15: download - view: text, markup, annotated - select for diffs
Wed Sep 25 15:23:03 2002 UTC (9 years, 4 months ago) by jdp
Branches: RELENG_4
CVS tags: RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7
Diff to: previous 1.3.2.14: preferred, colored
Changes since revision 1.3.2.14: +10 -2 lines
MFC 1.20: Set up the DMA Read/Write Control register more correctly.
(A fix for the transmit watchdog timeouts on Dell 2650 and possibly
other PCI-X systems.)

Approved by:	re

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sun Sep 22 19:27:07 2002 UTC (9 years, 4 months ago) by jdp
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +2 -1 lines
Fix a couple of longstanding typos which would have made a
statement fail to compile if it weren't inside "#ifdef
__brokenalpha__".

Submitted by:	Birger Toedtmann <birger@takatukaland.de>
MFC after:	2 weeks

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun Sep 22 18:58:58 2002 UTC (9 years, 4 months ago) by jdp
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +3 -46 lines
Follow the lead of recent changes in the 3com Linux driver by
disabling memory write invalidate unconditionally.  It looks like
they've decided that MWI just doesn't work with these devices.
Also, remove now-irrelevant code that set PCI write boundary values
based on the cache line size.

MFC after:	2 weeks

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sun Sep 22 18:27:29 2002 UTC (9 years, 4 months ago) by jdp
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +10 -2 lines
Set up the BCM570x chip's DMA Read/Write Control register more
correctly.  This fixes the "watchdog timeout -- resetting" errors
seen on Dell 2650 systems.

MFC after:	1 month

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun Sep 8 19:11:58 2002 UTC (9 years, 5 months ago) by jdp
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +19 -3 lines
Add support for the BCM5703x chips.  I do not have one of these
cards to test; however the submitter reports that this patch works
with the on-board interface on the IBM x235 server.

Submitted by:	Jung-uk Kim <jkim@niksun.com>
MFC after:	1 month

Revision 1.3.2.14: download - view: text, markup, annotated - select for diffs
Sat Jul 27 17:00:41 2002 UTC (9 years, 6 months ago) by jdp
Branches: RELENG_4
Diff to: previous 1.3.2.13: preferred, colored
Changes since revision 1.3.2.13: +2 -0 lines
MFC: Recognize the Altima AC9100 chip used in current versions of
the Netgear GA302-T.  This merges if_bge.c revision 1.18 and
if_bgereg.h revision 1.6.

PR:		kern/38988

Revision 1.18: download - view: text, markup, annotated - select for diffs
Fri Jul 26 03:47:07 2002 UTC (9 years, 6 months ago) by jdp
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -0 lines
Recognize the Altima AC9100 chip, which is used in current versions
of the Netgear GA302-T.  I changed the symbolic names in the
submitter's patch to reflect the part number of the chip instead
of the board.

PR:		kern/38988
Submitted by:	Brad Chapman <chapmanb@arches.uga.edu>
MFC after:	2 days

Revision 1.3.2.13: download - view: text, markup, annotated - select for diffs
Sat Jul 6 00:15:21 2002 UTC (9 years, 7 months ago) by jdp
Branches: RELENG_4
Diff to: previous 1.3.2.12: preferred, colored
Changes since revision 1.3.2.12: +1 -1 lines
MFC 1.17: Don't claim to support checksum offloading for IP fragments,
because it doesn't seem to work for UDP packets.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Thu Jul 4 23:19:20 2002 UTC (9 years, 7 months ago) by jdp
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +1 -1 lines
Disable hardware checksum offloading of IP fragments in the bge
driver.  I tried a few obvious experiments, but was unable to make
the 3c996B-T generate correct UDP checksums for transmitted fragmented
packets.  I'm not so sure the device is even capable of it.

This fixes NFS over UDP.

MFC after:	1 day

Revision 1.3.2.12: download - view: text, markup, annotated - select for diffs
Sun Jun 30 17:46:35 2002 UTC (9 years, 7 months ago) by jdp
Branches: RELENG_4
Diff to: previous 1.3.2.11: preferred, colored
Changes since revision 1.3.2.11: +3 -1 lines
MFC: Add missing splx call (if_bge.c revision 1.15).

Submitted by:	Mark Peek <mp@FreeBSD.org>

Revision 1.3.2.11: download - view: text, markup, annotated - select for diffs
Sun Jun 30 17:43:44 2002 UTC (9 years, 7 months ago) by jdp
Branches: RELENG_4
Diff to: previous 1.3.2.10: preferred, colored
Changes since revision 1.3.2.10: +36 -2 lines
MFC: Work around an apparent chip bug involving the BCM5701 on a
PCI-X bus and unaligned receive buffers.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Jun 29 01:36:59 2002 UTC (9 years, 7 months ago) by alfred
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +2 -2 lines
catch up with ext_free prototype change.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Mon Jun 24 22:28:42 2002 UTC (9 years, 7 months ago) by mp
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +3 -1 lines
Add missing splx().

MFC after:	3 days

Revision 1.14: download - view: text, markup, annotated - select for diffs
Mon Jun 24 22:04:15 2002 UTC (9 years, 7 months ago) by jdp
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +36 -2 lines
Work around what appears to be a chip bug in the BCM5701 that shows
up when operating in PCI-X mode.  For some received packets there is
data corruption in the first few bytes in that case.  Aligning the
packet buffer eliminates the corruption.  With this fix, the code
that offsets the packet buffer up by 2 bytes to align the payload is
disabled for BCM5701s operating in PCI-X mode.  On the i386, which
permits unaligned accesses, the payload is left unaligned.  On other
platforms, the packet is copied after reception to force alignment
of the payload.  Obviously, this work-around reduces performance in
those cases (BCM5701 plus PCI-X) where it is in effect.

MFC after:	3 days

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sun Apr 28 20:34:17 2002 UTC (9 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +2 -2 lines
Follow NetBSD and s/IFM_1000_TX/IFM_1000_T/

Revision 1.3.2.10: download - view: text, markup, annotated - select for diffs
Wed Apr 24 04:22:13 2002 UTC (9 years, 9 months ago) by jdp
Branches: RELENG_4
CVS tags: RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6
Diff to: previous 1.3.2.9: preferred, colored
Changes since revision 1.3.2.9: +4 -1 lines
MFC 1.11 -> 1.12: Add missing splx calls.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Apr 22 16:15:16 2002 UTC (9 years, 9 months ago) by jdp
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +4 -1 lines
Add missing splx calls in bge_tick.  These don't make any functional
difference in -current, but they are important for -stable where
they are missing too.

MFC after:	1 day

Revision 1.3.2.9: download - view: text, markup, annotated - select for diffs
Thu Apr 4 06:12:48 2002 UTC (9 years, 10 months ago) by wpaul
Branches: RELENG_4
Diff to: previous 1.3.2.8: preferred, colored
Changes since revision 1.3.2.8: +68 -17 lines
MFC: sync bge and bgrphy drivers with current (tweak support for BCM5701
cards, try to detect more kinds of fiber cards)

Revision 1.11: download - view: text, markup, annotated - select for diffs
Thu Apr 4 06:01:31 2002 UTC (9 years, 10 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +55 -15 lines
Try to sort out the correct way to generate async link state change
interrupts. This is a bit harder than it needs to be because there's
more than one way to generate link attentions, at least one of which
does not work on the BCM5700, but does on the 5701.

For the 5701, we can safely use the 'link changed' bit in the status
block, and we enable link change attentions in the mac event register.
For the 5700, we have to use MII interrupts, which require checking
the MAC status register rather than the status block. This requires
doing an extra register access on each interrupt which I'd prefer to
avoid, but them's the breaks. Testing with both a 3c996-T and 3c996B-T
shows that we do in fact detect the link going up and down properly
on cable insertions/disconnections.

Also, avoid twiddling the autopoll enable bit in the MI mode register
when doing a PHY read. I think this coupled with the other changes
will stop the interrupt storms Paul Saab has been harassing me about.
Manually setting the link to 100baseTX full duplex seems to work ok
for me. (I'm typing over the 3c996B-T right now.)

Lastly, teach the driver how to recognize a 3c996B-SX by checking
the hardware config word in the EEPROM in order to detect the media.
We attach 5701 fiber cards correctly now, but I haven't verified that
they send/receive packets yet since I don't have a second fiber
interface at home. (I know that fiber 5700 cards work, so I'm
keeping my fingers crossed.)

Revision 1.10: download - view: text, markup, annotated - select for diffs
Fri Mar 22 06:45:40 2002 UTC (9 years, 10 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +15 -4 lines
Teach the bge driver about the BCM5701 (specifically, the 3Com
3c996B-T, with the 5701 rev B5 ASIC). One thing that confuses me
still is that the 'link state change' bit in the status block seems
to change state an awful lot. I have a workaround for this in place
now, but it needs more investigation. For the moment though, this
is enough to get the driver to work with this card.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Wed Mar 20 02:03:28 2002 UTC (9 years, 10 months ago) by alfred
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +55 -57 lines
Remove __P.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Mon Feb 11 23:29:15 2002 UTC (10 years ago) by silby
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +0 -6 lines
Remove mbuf exhaustion warning messages; these are handled by the
mbuf system in a rate-limited fashion now.

MFC:	Already performed due to sloppiness.

Revision 1.3.2.8: download - view: text, markup, annotated - select for diffs
Mon Feb 11 23:26:36 2002 UTC (10 years ago) by silby
Branches: RELENG_4
Diff to: previous 1.3.2.7: preferred, colored
Changes since revision 1.3.2.7: +0 -6 lines
Remove mbuf exhaustion warning messages; these are handled by the
mbuf system in a rate-limited fashion now.

MFC after:	3 days

Revision 1.3.2.7: download - view: text, markup, annotated - select for diffs
Thu Jan 31 05:25:40 2002 UTC (10 years ago) by jdp
Branches: RELENG_4
Diff to: previous 1.3.2.6: preferred, colored
Changes since revision 1.3.2.6: +2 -0 lines
MFC: add support for the Netgear GA302T 10/100/1000 adapter.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Jan 27 01:00:16 2002 UTC (10 years ago) by jdp
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -0 lines
Add support for the Netgear GA302T 10/100/1000 adapter.  Given that
it's a 32-bit card, it's quite nice for $75.

MFC after:	3 days

Revision 1.3.2.6: download - view: text, markup, annotated - select for diffs
Tue Dec 18 08:08:34 2001 UTC (10 years, 1 month ago) by peter
Branches: RELENG_4
CVS tags: RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5
Diff to: previous 1.3.2.5: preferred, colored
Changes since revision 1.3.2.5: +4 -0 lines
MFC: 1.6 (trivial): bge_vpd_read*() defined but not used (#ifdef notdef)

Revision 1.6: download - view: text, markup, annotated - select for diffs
Tue Dec 18 08:03:25 2001 UTC (10 years, 1 month ago) by peter
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +4 -0 lines
Fix warnings: the bge_bpd_read*() functions are not used (#ifdef notdef)

Revision 1.3.2.5: download - view: text, markup, annotated - select for diffs
Tue Dec 18 00:35:24 2001 UTC (10 years, 1 month ago) by dg
Branches: RELENG_4
Diff to: previous 1.3.2.4: preferred, colored
Changes since revision 1.3.2.4: +2 -0 lines
MFC rev 1.5: disabled input hardware assisted checksum due to it being
broken for some packets.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Fri Dec 14 22:04:58 2001 UTC (10 years, 1 month ago) by dg
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -0 lines
Disabled input hardware checksum due to it being calculated incorrected
for some packets, in particular small (0 byte payload) packets. May also
be related to TCP options.

Approved by:	wpaul
MFC after:	3 days

Revision 1.3.2.4: download - view: text, markup, annotated - select for diffs
Fri Dec 14 19:48:08 2001 UTC (10 years, 1 month ago) by jlemon
Branches: RELENG_4
Diff to: previous 1.3.2.3: preferred, colored
Changes since revision 1.3.2.3: +14 -3 lines
MFC: interface capability support.

Revision 1.3.2.3: download - view: text, markup, annotated - select for diffs
Tue Dec 4 20:01:52 2001 UTC (10 years, 2 months ago) by brooks
Branches: RELENG_4
Diff to: previous 1.3.2.2: preferred, colored
Changes since revision 1.3.2.2: +4 -17 lines
MFC: Make vlan(4) devices loadable, unloadable, and clonable.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Dec 3 17:28:26 2001 UTC (10 years, 2 months ago) by brooks
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +3 -3 lines
Don't pass an interface pointer to VLAN_INPUT{,_TAG}.  Get it from the
mbuf instead.

Suggested by:	fenner

Revision 1.3.2.2: download - view: text, markup, annotated - select for diffs
Fri Oct 5 20:13:41 2001 UTC (10 years, 4 months ago) by wpaul
Branches: RELENG_4
Diff to: previous 1.3.2.1: preferred, colored
Changes since revision 1.3.2.1: +3 -3 lines
Fix small vlan bug in bge_encap(): IFT_8021_VLAN -> IFT_L2VLAN
(For some reason I was under the impression that IFT_8021_VLAN was
the right constant to use in -stable. Mea Culpa.)

Pointed out by: Mark Peek

Revision 1.3.2.1: download - view: text, markup, annotated - select for diffs
Mon Oct 1 18:19:11 2001 UTC (10 years, 4 months ago) by wpaul
Branches: RELENG_4
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +127 -59 lines
MFC: add the if_bge (Broadcom BCM570x gig ethernet) driver to -stable

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Sep 29 19:31:29 2001 UTC (10 years, 4 months ago) by jlemon
Branches: MAIN
Branch point for: RELENG_4
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +11 -14 lines
Do not call mii_polltick() immediately after mii_tick().

Poiinted out by: wpaul

Revision 1.2: download - view: text, markup, annotated - select for diffs
Fri Sep 28 18:56:57 2001 UTC (10 years, 4 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +5 -5 lines
Set the 'no pseudo header checksum' option for RX checksums, otherwise
we may botch UDP checksums on receive, which will break NFS.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Thu Sep 27 23:55:27 2001 UTC (10 years, 4 months ago) by wpaul
Branches: MAIN
Add device driver support for the Broadcom BCM570x family of gigabit
ethernet controllers. This adds support for the 3Com 3c996-T, the
SysKonnect SK-9D21 and SK-9D41, and the built-in gigE NICs on
Dell PowerEdge 2550 servers. The latter configuration hauls ass:
preliminary measurements show TCP speeds of over 900Mbps using
only normal size frames.

TCP/IP checksum offload, jumbo frames and VLAN tag insertion/stripping
are supported, as well as interrupt moderation.

Still need to fix autonegotiation support for 1000baseSX NICs, but
beyond that, driver is pretty solid.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options