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

CVS log for src/sys/dev/fxp/if_fxpvar.h

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.52.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.52.2.1: preferred, colored
Changes since revision 1.52.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.52.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.52: preferred, colored
Changes since revision 1.52: +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.40.2.12.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
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.40.2.12: preferred, colored; next MAIN 1.40.6.1: preferred, colored
Changes since revision 1.40.2.12: +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.49.2.4.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
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.49.2.4: preferred, colored; next MAIN 1.50: preferred, colored
Changes since revision 1.49.2.4: +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.40.2.12: download - view: text, markup, annotated - select for diffs
Sun Nov 28 15:59:45 2010 UTC (14 months, 1 week ago) by marius
Branches: RELENG_7
CVS tags: RELENG_7_4_BP
Branch point for: RELENG_7_4
Diff to: previous 1.40.2.11: preferred, colored; branchpoint 1.40: preferred, colored; next MAIN 1.41: preferred, colored
Changes since revision 1.40.2.11: +0 -1 lines
SVN rev 216003 on 2010-11-28 15:59:45Z by marius

MFC: r215906

Fix and implement missing parts of flow control support. This also removes
the dev.fxp.%d.noflow tunable as the same effect can now be achieved with
ifconfig(8) by setting the flowcontrol media option as desired (besides
the tunable never having a chance to actually enable flow control support
so far).
In joint forces with:	yongari

Revision 1.49.2.4: download - view: text, markup, annotated - select for diffs
Sun Nov 28 15:59:39 2010 UTC (14 months, 1 week ago) by marius
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.49.2.3: preferred, colored; branchpoint 1.49: preferred, colored; next MAIN 1.50: preferred, colored
Changes since revision 1.49.2.3: +0 -1 lines
SVN rev 216002 on 2010-11-28 15:59:39Z by marius

MFC: r215906

Fix and implement missing parts of flow control support. This also removes
the dev.fxp.%d.noflow tunable as the same effect can now be achieved with
ifconfig(8) by setting the flowcontrol media option as desired (besides
the tunable never having a chance to actually enable flow control support
so far).
In joint forces with:	yongari

Revision 1.52: download - view: text, markup, annotated - select for diffs
Fri Nov 26 21:52:33 2010 UTC (14 months, 2 weeks ago) by marius
Branches: MAIN
CVS tags: RELENG_9_BP, HEAD
Branch point for: RELENG_9
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +0 -1 lines
SVN rev 215906 on 2010-11-26 21:52:33Z by marius

Fix and implement missing parts of flow control support. This also removes
the dev.fxp.%d.noflow tunable as the same effect can now be achieved with
ifconfig(8) by setting the flowcontrol media option as desired (besides
the tunable never having a chance to actually enable flow control support
so far).
In joint forces with:	yongari

Revision 1.49.2.3: download - view: text, markup, annotated - select for diffs
Fri Nov 26 21:02:57 2010 UTC (14 months, 2 weeks ago) by marius
Branches: RELENG_8
Diff to: previous 1.49.2.2: preferred, colored; branchpoint 1.49: preferred, colored
Changes since revision 1.49.2.2: +2 -2 lines
SVN rev 215893 on 2010-11-26 21:02:57Z by marius

MFC: r215768

- Sprinkle const on tables.
- Remove an alpha remnant.
- Minor comment and style fixes.

Revision 1.40.2.11: download - view: text, markup, annotated - select for diffs
Fri Nov 26 21:02:54 2010 UTC (14 months, 2 weeks ago) by marius
Branches: RELENG_7
Diff to: previous 1.40.2.10: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.2.10: +2 -2 lines
SVN rev 215892 on 2010-11-26 21:02:54Z by marius

MFC: r215768

- Sprinkle const on tables.
- Remove an alpha remnant.
- Minor comment and style fixes.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Tue Nov 23 21:09:42 2010 UTC (14 months, 2 weeks ago) by marius
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +2 -2 lines
SVN rev 215768 on 2010-11-23 21:09:42Z by marius

- Sprinkle const on tables.
- Remove an alpha remnant.
- Minor comment and style fixes.

Revision 1.49.2.2.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.49.2.2: preferred, colored; next MAIN 1.49.2.3: preferred, colored
Changes since revision 1.49.2.2: +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.40.2.10: download - view: text, markup, annotated - select for diffs
Mon May 17 16:59:36 2010 UTC (20 months, 3 weeks ago) by yongari
Branches: RELENG_7
Diff to: previous 1.40.2.9: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.2.9: +25 -0 lines
SVN rev 208200 on 2010-05-17 16:59:36Z by yongari

MFC r207832:
  Export hardware MAC statistics through sysctl node. Previously
  fxp(4) already used to extract most hardware MAC statistics but it
  didn't show them. With this change, all MAC statistics counters
  are exported. Because there are a couple of new counters for 82558
  and 82559, enable extended MAC statistics functionality to get
  these counters. Accoring to public data sheet, 82559 MAC statistics
  return 24 DWORD counters(3 counters are unknown at this moment) so
  increase MAC counter structure to meet the MAC statistics block size.
  The completion of MAC counter dump is now checked against
  FXP_STATS_DR_COMPLETE status code which is appended at the end of
  status block. Previously fxp(4) ignored the status of the
  FXP_SCB_COMMAND_CU_DUMPRESET command. fxp(4) does not wait for the
  completion of pending command before issuing
  FXP_SCB_COMMAND_CU_DUMPRESET. Instead it skips the command and try
  it next time. This scheme may show better performance but there is
  chance to loose updated counters after stopping controller. So make
  sure to update MAC statistics in fxp_stop().
  While I'm here move sysctl node creation to fxp_sysctl_node().

  Tested by:	Larry Baird < lab <> gta dot com >

Revision 1.49.2.2: download - view: text, markup, annotated - select for diffs
Mon May 17 16:57:55 2010 UTC (20 months, 3 weeks ago) by yongari
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.49.2.1: preferred, colored; branchpoint 1.49: preferred, colored
Changes since revision 1.49.2.1: +25 -0 lines
SVN rev 208199 on 2010-05-17 16:57:55Z by yongari

MFC r207832:
  Export hardware MAC statistics through sysctl node. Previously
  fxp(4) already used to extract most hardware MAC statistics but it
  didn't show them. With this change, all MAC statistics counters
  are exported. Because there are a couple of new counters for 82558
  and 82559, enable extended MAC statistics functionality to get
  these counters. Accoring to public data sheet, 82559 MAC statistics
  return 24 DWORD counters(3 counters are unknown at this moment) so
  increase MAC counter structure to meet the MAC statistics block size.
  The completion of MAC counter dump is now checked against
  FXP_STATS_DR_COMPLETE status code which is appended at the end of
  status block. Previously fxp(4) ignored the status of the
  FXP_SCB_COMMAND_CU_DUMPRESET command. fxp(4) does not wait for the
  completion of pending command before issuing
  FXP_SCB_COMMAND_CU_DUMPRESET. Instead it skips the command and try
  it next time. This scheme may show better performance but there is
  chance to loose updated counters after stopping controller. So make
  sure to update MAC statistics in fxp_stop().
  While I'm here move sysctl node creation to fxp_sysctl_node().

  Tested by:	Larry Baird < lab <> gta dot com >

Revision 1.50: download - view: text, markup, annotated - select for diffs
Sun May 9 22:16:15 2010 UTC (21 months ago) by yongari
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +25 -0 lines
SVN rev 207832 on 2010-05-09 22:16:15Z by yongari

Export hardware MAC statistics through sysctl node. Previously
fxp(4) already used to extract most hardware MAC statistics but it
didn't show them. With this change, all MAC statistics counters
are exported. Because there are a couple of new counters for 82558
and 82559, enable extended MAC statistics functionality to get
these counters. Accoring to public data sheet, 82559 MAC statistics
return 24 DWORD counters(3 counters are unknown at this moment) so
increase MAC counter structure to meet the MAC statistics block size.
The completion of MAC counter dump is now checked against
FXP_STATS_DR_COMPLETE status code which is appended at the end of
status block. Previously fxp(4) ignored the status of the
FXP_SCB_COMMAND_CU_DUMPRESET command. fxp(4) does not wait for the
completion of pending command before issuing
FXP_SCB_COMMAND_CU_DUMPRESET. Instead it skips the command and try
it next time. This scheme may show better performance but there is
chance to loose updated counters after stopping controller. So make
sure to update MAC statistics in fxp_stop().
While I'm here move sysctl node creation to fxp_sysctl_node().

Tested by:	Larry Baird < lab <> gta dot com >

Revision 1.40.2.9.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.40.2.9: preferred, colored; next MAIN 1.40.2.10: preferred, colored
Changes since revision 1.40.2.9: +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.40.2.9: download - view: text, markup, annotated - select for diffs
Wed Nov 4 18:22:59 2009 UTC (2 years, 3 months ago) by yongari
Branches: RELENG_7
CVS tags: RELENG_7_3_BP
Branch point for: RELENG_7_3
Diff to: previous 1.40.2.8: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.2.8: +8 -0 lines
SVN rev 198918 on 2009-11-04 18:22:59Z by yongari

MFC r194574:
  For ICH based fxp(4) controllers treat them as 82559 compatibles.
  To detect which controller is ICH based one, add a new member
  variable ich to struct fxp_ident and move the struct to
  if_fxpvar.h. Since I've faked controller revision, don't allow
  microcode loading for ICH based controllers.
  With this change all ICH based controllers will have WOL and Rx
  checksum offload capability.

  PR:		kern/135451
  Tested by:	Alexey Shuvaev ( shuvaev <> physik dot uni-wuerzburg dot de ),
		pluknet ( pluknet <> gmail dot com ),
		Gary Jennejohn ( gary.jennejohn <> freenet dot de )

Revision 1.40.2.8: download - view: text, markup, annotated - select for diffs
Wed Nov 4 18:20:31 2009 UTC (2 years, 3 months ago) by yongari
Branches: RELENG_7
Diff to: previous 1.40.2.7: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.2.7: +1 -2 lines
SVN rev 198917 on 2009-11-04 18:20:31Z by yongari

MFC r194573:
  Overhaul fxp(4) multicast filter programming. fxp(4) hardwares do
  not allow multicast filter programming when controller is busy to
  send/receive frames. So it used to mark need_mcsetup bit and defer
  multicast filter programming until controller becomes idle state.
  To detect when the controller is idle fxp(4) relied on Tx
  completion interrupt with NOP command and fxp_start_body and
  fxp_intr_body had to see whether pending multicast filter
  programming was requested. This resulted in very complex logic and
  sometimes it did not work as expected.
  Since the controller should be in idle state before any multicast
  filter modifications I changed it to reinitialize the controller
  whenever multicast filter programming is required. This is the same
  way what OpenBSD and NetBSD does. Also I added IFF_DRV_RUNNING
  check in ioctl handler so controller would be reinitialized only if
  it is absolutely needed.
  With this change I guess we can remove fxp(4) DELAY hack in ifioctl
  for IPv6 case.

Revision 1.40.2.7: download - view: text, markup, annotated - select for diffs
Wed Nov 4 18:14:19 2009 UTC (2 years, 3 months ago) by yongari
Branches: RELENG_7
Diff to: previous 1.40.2.6: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.2.6: +1 -0 lines
SVN rev 198915 on 2009-11-04 18:14:19Z by yongari

MFC r194571:
  Don't blindly enable Rx lock-up workaround. Newer chips do not need
  the Rx lock-up workaround.

  Obtained from:        NetBSD

Revision 1.40.2.6: download - view: text, markup, annotated - select for diffs
Wed Nov 4 18:07:09 2009 UTC (2 years, 3 months ago) by yongari
Branches: RELENG_7
Diff to: previous 1.40.2.5: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.2.5: +2 -1 lines
SVN rev 198913 on 2009-11-04 18:07:09Z by yongari

MFC r194569:
  Introduce Rx mbuf dma tag and use it in Rx path. Previously it used
  common mbuf dma tag for both Tx and Rx path but Rx buffer should
  have single DMA segment and maximum buffer size of the segment
  should be less than MCLBYTES.
  fxp(4) also have to check Tx completion status which was updated by
  DMA so we need BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTWRITE
  synchronization in Tx path. Fix all misuse of bus_dmamap_sync(9) in
  fxp(4). I guess this change shall fix occasional driver breakage in
  PAE environments.

  While I'm here add error messages of dma tag/buffer creation and
  correct messages.

Revision 1.49.2.1.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.49.2.1: preferred, colored; next MAIN 1.49.2.2: preferred, colored
Changes since revision 1.49.2.1: +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.49.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
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +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.49: download - view: text, markup, annotated - select for diffs
Sun Jun 21 07:34:12 2009 UTC (2 years, 7 months ago) by yongari
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +8 -0 lines
SVN rev 194574 on 2009-06-21 07:34:12Z by yongari

For ICH based fxp(4) controllers treat them as 82559 compatibles.
To detect which controller is ICH based one, add a new member
variable ich to struct fxp_ident and move the struct to
if_fxpvar.h. Since I've faked controller revision, don't allow
microcode loading for ICH based controllers.
With this change all ICH based controllers will have WOL and Rx
checksum offload capability.

PR:		kern/135451
Tested by:	Alexey Shuvaev ( shuvaev <> physik dot uni-wuerzburg dot de ),
		pluknet ( pluknet <> gmail dot com ),
		Gary Jennejohn ( gary.jennejohn <> freenet dot de )

Revision 1.48: download - view: text, markup, annotated - select for diffs
Sun Jun 21 07:17:49 2009 UTC (2 years, 7 months ago) by yongari
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +1 -2 lines
SVN rev 194573 on 2009-06-21 07:17:49Z by yongari

Overhaul fxp(4) multicast filter programming. fxp(4) hardwares do
not allow multicast filter programming when controller is busy to
send/receive frames. So it used to mark need_mcsetup bit and defer
multicast filter programming until controller becomes idle state.
To detect when the controller is idle fxp(4) relied on Tx
completion interrupt with NOP command and fxp_start_body and
fxp_intr_body had to see whether pending multicast filter
programming was requested. This resulted in very complex logic and
sometimes it did not work as expected.
Since the controller should be in idle state before any multicast
filter modifications I changed it to reinitialize the controller
whenever multicast filter programming is required. This is the same
way what OpenBSD and NetBSD does. Also I added IFF_DRV_RUNNING
check in ioctl handler so controller would be reinitialized only if
it is absolutely needed.
With this change I guess we can remove fxp(4) DELAY hack in ifioctl
for IPv6 case.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Sun Jun 21 06:27:35 2009 UTC (2 years, 7 months ago) by yongari
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +1 -0 lines
SVN rev 194571 on 2009-06-21 06:27:35Z by yongari

Don't blindly enable Rx lock-up workaround. Newer chips do not need
the Rx lock-up workaround.

Obtained from:	NetBSD

Revision 1.46: download - view: text, markup, annotated - select for diffs
Sun Jun 21 06:06:43 2009 UTC (2 years, 7 months ago) by yongari
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +2 -1 lines
SVN rev 194569 on 2009-06-21 06:06:43Z by yongari

Introduce Rx mbuf dma tag and use it in Rx path. Previously it used
common mbuf dma tag for both Tx and Rx path but Rx buffer should
have single DMA segment and maximum buffer size of the segment
should be less than MCLBYTES.
fxp(4) also have to check Tx completion status which was updated by
DMA so we need BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTWRITE
synchronization in Tx path. Fix all misuse of bus_dmamap_sync(9) in
fxp(4). I guess this change shall fix occasional driver breakage in
PAE environments.

While I'm here add error messages of dma tag/buffer creation and
correct messages.

Revision 1.40.2.5.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.40.2.5: preferred, colored; next MAIN 1.40.2.6: preferred, colored
Changes since revision 1.40.2.5: +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.40.2.5: download - view: text, markup, annotated - select for diffs
Mon Feb 9 03:53:20 2009 UTC (3 years ago) by yongari
Branches: RELENG_7
CVS tags: RELENG_7_2_BP
Branch point for: RELENG_7_2
Diff to: previous 1.40.2.4: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.2.4: +2 -0 lines
SVN rev 188375 on 2009-02-09 03:53:20Z by yongari

MFC r185354,185538:
 r185354:
  Add basic WOL support for 82550/82551/82558 and 82559 based
  controllers. ICH based controllers are treated as 82559. 82557,
  earlier revision of 82558 and 82559ER have no WOL capability.
   o WOL support requires help of a firmware so add check whether
     hardware is capable of handling magic frames by reading EEPROM.
   o Enable accepting WOL frames only when hardware is about to
     suspend or shutdown. Previously fxp(4) used to allow receipt of
     magic frame under normal operation mode which could cause
     hardware hang if magic frame is received by hardware. Datasheet
     clearly states driver should not allow WOL frames under normal
     operation mode.
   o Disable WOL frame reception in device attach so have fxp(4)
     immunize against system hang which can be triggered by magic
     packets when the hardware is not in fully initialized state.
   o Don't reset all hardware configuration data in fxp_stop()
     otherwise important configuration data is lost and this would
     reset WOL configuration to default state which in turn cause
     hardware hang on receipt of magic frames. To fix the issue,
     preserve hardware configuration data by issuing a selective
     reset.
   o Explicitly disable interrupts after issuing selective reset as
     reset may unmask interrupts.

 r185538:
  Make sure to clear PMDR register by writing back power management
  events. Just reading PMDR register was not enough to have fxp(4)
  immuninize against received magic packets during system boot.

Revision 1.40.2.4: download - view: text, markup, annotated - select for diffs
Mon Feb 9 03:48:49 2009 UTC (3 years ago) by yongari
Branches: RELENG_7
Diff to: previous 1.40.2.3: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.2.3: +6 -0 lines
SVN rev 188374 on 2009-02-09 03:48:49Z by yongari

MFC r185330:
  Implement TSO for 82550/82551 controllers.
   o Configure controller to use dynamic TBD as TSO requires that
     operation mode.
   o Add a dummy TBD to tx_cb_u as TSO can access one more TBD in TSO
     operation.
   o Increase a DMA segment size to 4096 to hold a full IP segment
     with link layer header.
   o Unlike other TSO capable controllers, 82550/82551 does not
     modify the first IP packet in TSO operation so driver should
     create an IP packet with proper header. Subsequent IP packets
     are generated from the header information in the first IP packet
     header. Likewise pseudo checksum also should be computed by
     driver for the first packet.
   o TSO requires one more TBD to hold total TCP payload. To make
     code simple for TSO/non-TSO case, increase the index of the
     first available TBD array.
   o Remove KASSERT that checks the size of a DMA segment should be
     less than or equal to MCLBYTES as it's no longer valid in TSO.
   o Tx threshold and number of TBDs field is used to store MSS in
     TSO. So don't set the Tx threshold in TSO case.

Revision 1.40.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 9 03:46:15 2009 UTC (3 years ago) by yongari
Branches: RELENG_7
Diff to: previous 1.40.2.2: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.2.2: +1 -0 lines
SVN rev 188373 on 2009-02-09 03:46:15Z by yongari

MFC r185329:
  Implement Rx checksum offload for 82559 or later controllers.
  82559 or later controllers added simple checksum calculation logic
  in RU. For backward compatibility the computed checksum is appended
  at the end of the data posted to Rx buffer. This type of simple
  checksum calculation support had been used on several vendors such
  as Sun HME/GEM, SysKonnect GENESIS and Marvell Yukon controllers.
  Because this type of checksum offload support requires parsing of
  received frame and pseudo checksum calculation with software
  routine it still consumes more CPU cycles than that of full-fledged
  checksum offload controller. But it's still better than software
  checksum calculation.

Revision 1.40.2.2: download - view: text, markup, annotated - select for diffs
Mon Feb 9 03:38:01 2009 UTC (3 years ago) by yongari
Branches: RELENG_7
Diff to: previous 1.40.2.1: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.2.1: +1 -0 lines
SVN rev 188370 on 2009-02-09 03:38:01Z by yongari

MFC r185285:
  - Allow fxp_encap() enqueue failed transmissions and set
    IFF_DRV_OACTIVE to note resource shortage to upper stack.
  - Don't count number of mbuf chains. Default 32 DMA segments for a
    frame is enough for most cases. If bus_dmamap_mbuf_sg fails use
    m_collapse(9) to collapse the mbuf chain instead of relying on
    expensive m_defrag(9).
  - Move bpf handling to fxp_start_body() which is supposed to be
    more appropriate place.
  - Always arm watchdog timer whenever a new Tx request is made.
    Previously fxp(4) used to arm watchdog timer only when
    FXP_CXINT_THRESH-th Tx request is made. Because fxp(4) does not
    rely on Tx interrupt to reclaim transmitted mbufs it's better to
    arm watchdog timer to detect potential lockups.
  - Add more aggresive Tx buffer reclaiming in fxp_start_body to make
    room for new Tx requests. Since fxp(4) does not request Tx
    completion interrupt for every frames it's necessary to clean
    TXCBs in advance to saturate link.
  - Make fxp(4) try to start more packets transmitting regardless of
    interrupt type in fxp_intr_body.

Revision 1.40.2.1: download - view: text, markup, annotated - select for diffs
Mon Feb 9 03:28:57 2009 UTC (3 years ago) by yongari
Branches: RELENG_7
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +6 -6 lines
SVN rev 188366 on 2009-02-09 03:28:57Z by yongari

MFC r185269,185271-185272
 r185269:
  Whitespace fix.

 r185271:
  Sort head files and removed ununsed header file.

 r185272:
  Make fxp(4) build with FXP_IP_CSUM_WAR.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Thu Nov 27 01:57:23 2008 UTC (3 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +2 -0 lines
SVN rev 185354 on 2008-11-27 01:57:23Z by yongari

Add basic WOL support for 82550/82551/82558 and 82559 based
controllers. ICH based controllers are treated as 82559. 82557,
earlier revision of 82558 and 82559ER have no WOL capability.
 o WOL support requires help of a firmware so add check whether
   hardware is capable of handling magic frames by reading EEPROM.
 o Enable accepting WOL frames only when hardware is about to
   suspend or shutdown. Previously fxp(4) used to allow receipt of
   magic frame under normal operation mode which could cause
   hardware hang if magic frame is received by hardware. Datasheet
   clearly states driver should not allow WOL frames under normal
   operation mode.
 o Disable WOL frame reception in device attach so have fxp(4)
   immunize against system hang which can be triggered by magic
   packets when the hardware is not in fully initialized state.
 o Don't reset all hardware configuration data in fxp_stop()
   otherwise important configuration data is lost and this would
   reset WOL configuration to default state which in turn cause
   hardware hang on receipt of magic frames. To fix the issue,
   preserve hardware configuration data by issuing a selective
   reset.
 o Explicitly disable interrupts after issuing selective reset as
   reset may unmask interrupts.

Tested by:	Alexey Shuvaev < shuvaev <> physik DOT uni-wuerzburg DOT de >

Revision 1.44: download - view: text, markup, annotated - select for diffs
Wed Nov 26 07:36:17 2008 UTC (3 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +6 -0 lines
SVN rev 185330 on 2008-11-26 07:36:17Z by yongari

Implement TSO for 82550/82551 controllers.
 o Configure controller to use dynamic TBD as TSO requires that
   operation mode.
 o Add a dummy TBD to tx_cb_u as TSO can access one more TBD in TSO
   operation.
 o Increase a DMA segment size to 4096 to hold a full IP segment
   with link layer header.
 o Unlike other TSO capable controllers, 82550/82551 does not
   modify the first IP packet in TSO operation so driver should
   create an IP packet with proper header. Subsequent IP packets
   are generated from the header information in the first IP packet
   header. Likewise pseudo checksum also should be computed by
   driver for the first packet.
 o TSO requires one more TBD to hold total TCP payload. To make
   code simple for TSO/non-TSO case, increase the index of the
   first available TBD array.
 o Remove KASSERT that checks the size of a DMA segment should be
   less than or equal to MCLBYTES as it's no longer valid in TSO.
 o Tx threshold and number of TBDs field is used to store MSS in
   TSO. So don't set the Tx threshold in TSO case.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Wed Nov 26 06:36:53 2008 UTC (3 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +1 -0 lines
SVN rev 185329 on 2008-11-26 06:36:53Z by yongari

Implement Rx checksum offload for 82559 or later controllers.
82559 or later controllers added simple checksum calculation logic
in RU. For backward compatibility the computed checksum is appended
at the end of the data posted to Rx buffer. This type of simple
checksum calculation support had been used on several vendors such
as Sun HME/GEM, SysKonnect GENESIS and Marvell Yukon controllers.
Because this type of checksum offload support requires parsing of
received frame and pseudo checksum calculation with software
routine it still consumes more CPU cycles than that of full-fledged
checksum offload controller. But it's still better than software
checksum calculation.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Tue Nov 25 04:16:16 2008 UTC (3 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +1 -0 lines
SVN rev 185285 on 2008-11-25 04:16:16Z by yongari

- Allow fxp_encap() enqueue failed transmissions and set
  IFF_DRV_OACTIVE to note resource shortage to upper stack.
- Don't count number of mbuf chains. Default 32 DMA segments for a
  frame is enough for most cases. If bus_dmamap_mbuf_sg fails use
  m_collapse(9) to collapse the mbuf chain instead of relying on
  expensive m_defrag(9).
- Move bpf handling to fxp_start_body() which is supposed to be
  more appropriate place.
- Always arm watchdog timer whenever a new Tx request is made.
  Previously fxp(4) used to arm watchdog timer only when
  FXP_CXINT_THRESH-th Tx request is made. Because fxp(4) does not
  rely on Tx interrupt to reclaim transmitted mbufs it's better to
  arm watchdog timer to detect potential lockups.
- Add more aggresive Tx buffer reclaiming in fxp_start_body to make
  room for new Tx requests. Since fxp(4) does not request Tx
  completion interrupt for every frames it's necessary to clean
  TXCBs in advance to saturate link.
- Make fxp(4) try to start more packets transmitting regardless of
  interrupt type in fxp_intr_body.

Revision 1.40.6.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
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.40: preferred, colored; next MAIN 1.41: preferred, colored
Changes since revision 1.40: +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.41: download - view: text, markup, annotated - select for diffs
Tue Nov 25 00:48:05 2008 UTC (3 years, 2 months ago) by yongari
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +6 -6 lines
SVN rev 185269 on 2008-11-25 00:48:05Z by yongari

Whitespace fix.

Revision 1.37.2.1.10.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.37.2.1: preferred, colored; next MAIN 1.38: preferred, colored
Changes since revision 1.37.2.1: +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.40: download - view: text, markup, annotated - select for diffs
Thu Nov 30 14:58:01 2006 UTC (5 years, 2 months ago) by glebius
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_1_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0
Branch point for: RELENG_7_1, RELENG_7
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +1 -0 lines
- Instead of if_watchdog/if_timer interface use our own timer
  that piggybacks on fxp_tick() callout.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Tue Sep 27 09:01:11 2005 UTC (6 years, 4 months ago) by mux
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +8 -18 lines
Convert fxp(4) to use the new bus_alloc_resources() API, it simplifies
the resource allocation code significantly.

Revision 1.37.2.1: download - view: text, markup, annotated - select for diffs
Fri Aug 26 14:35:45 2005 UTC (6 years, 5 months ago) by jhb
Branches: RELENG_6
CVS tags: RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3, RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2, RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Branch point for: RELENG_6_4
Diff to: previous 1.37: preferred, colored; next MAIN 1.38: preferred, colored
Changes since revision 1.37: +0 -12 lines
MFC: Fix up locking and remove spls and support for 4.x.

Approved by:	re (scottl)

Revision 1.38: download - view: text, markup, annotated - select for diffs
Mon Aug 8 21:03:54 2005 UTC (6 years, 6 months ago) by jhb
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +0 -12 lines
- Use callout_init_mtx() to close a small race between callout_stop() and
  the timeout routine.
- Fix locking in detach.
- Add locking in shutdown.
- Don't mess with the PCI command register in resume, the PCI bus driver
  already does this for us.
- Add locking to the non-serial ifmedia routines.
- Fix locking in ioctl.
- Remove spls and support for 4.x.

MFC after:	1 week

Revision 1.37: download - view: text, markup, annotated - select for diffs
Fri Jun 10 16:49:09 2005 UTC (6 years, 8 months ago) by brooks
Branches: MAIN
CVS tags: RELENG_6_BP
Branch point for: RELENG_6
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +1 -3 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.36: download - view: text, markup, annotated - select for diffs
Sun Jun 5 22:50:55 2005 UTC (6 years, 8 months ago) by imp
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +0 -5 lines
The PCI bus code saves/restores these config registers now.

Revision 1.32.2.2: download - view: text, markup, annotated - select for diffs
Sun May 8 01:16:41 2005 UTC (6 years, 9 months ago) by mux
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5
Diff to: previous 1.32.2.1: preferred, colored; branchpoint 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32.2.1: +11 -11 lines
MFC the conversion to C99 types to reduce differences with HEAD.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Mon Mar 7 13:20:49 2005 UTC (6 years, 11 months ago) by mux
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +1 -0 lines
- Encapsulate the code responsible for initializing a new TX descriptor
  from an mbuf into the fxp_encap() function, as done in other drivers.
- Don't waste time calling bus_dmamap_load_mbuf() if we know the mbuf
  chain is too long to fit in a TX descriptor, call m_defrag() first.
- Convert fxp(4) to use bus_dmamap_load_mbuf_sg().

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sun Mar 6 05:07:26 2005 UTC (6 years, 11 months ago) by mux
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +11 -11 lines
Cleanup: u_intXX_t -> uintX_t conversion.

Revision 1.32.2.1: download - view: text, markup, annotated - select for diffs
Sun Jan 30 00:59:42 2005 UTC (7 years ago) by imp
Branches: RELENG_5
CVS tags: RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +1 -1 lines
MFC: /*- and my license changes for sys/[a-d]*

Revision 1.33: download - view: text, markup, annotated - select for diffs
Thu Jan 6 01:42:42 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +1 -1 lines
Start each of the license/copyright comments with /*-, minor shuffle of lines

Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Jun 2 22:59:57 2004 UTC (7 years, 8 months ago) by mux
Branches: MAIN
CVS tags: RELENG_5_BP, RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Branch point for: RELENG_5
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +4 -2 lines
Abstract the locking in fxp(4) a bit more by using macros for
mtx_assert() and mtx_owned(), as it is done in other places,
for instance proc locking.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Wed Jun 2 22:52:18 2004 UTC (7 years, 8 months ago) by mux
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -2 lines
Use the device sysctl tree instead of rolling our own.  Some of the
sysctls were global (hw.fxp_rnr and hw.fxp_noflow), all of them are
now per-device.  Sample output of "sysctl dev.fxp0" with this patch,
with the standard %foo nodes removed :

dev.fxp0.int_delay: 1000
dev.fxp0.bundle_max: 6
dev.fxp0.rnr: 0
dev.fxp0.noflow: 0

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue May 25 14:49:46 2004 UTC (7 years, 8 months ago) by yar
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +1 -0 lines
Teach fxp(4) to control VLAN_MTU in the hardware.
Now reception of extended frames can be toggled
through ioctl(SIOCSIFCAP).

The card will also receive extended frames when
in promiscuous mode.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Thu Oct 30 23:12:24 2003 UTC (8 years, 3 months ago) by brooks
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.28: preferred, colored
Changes since revision 1.28: +0 -2 lines
Remove unused FXP_UNIT() macro.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Fri Sep 5 22:37:31 2003 UTC (8 years, 5 months ago) by sam
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +1 -1 lines
change timeout to be MPSAFE

Sponsored by:	FreeBSD Foundation

Revision 1.27: download - view: text, markup, annotated - select for diffs
Wed Apr 30 01:54:38 2003 UTC (8 years, 9 months ago) by imp
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +1 -2 lines
Get rid of the redundant 'gone' field, and overload suspend instead.
Check for suspend before the device polling, rather than after it.
Check to see if the current thread owns the lock in ioctl and return
EBUSY if it does.

This advances the locking to the point that I can eject my fxp card 10
times in a row, but I agree with Jeff Hsu that we need to get the
network layer locking finished before chasing more of the races here
(actually, he doesn't think this set is worth it even).  There's a
number of races between FXP_LOCK in detach and all other users of
FXP_LOCK, and this gets back to the 'device with sleepers being
forcibly detached' problem as well...

Revision 1.26: download - view: text, markup, annotated - select for diffs
Tue Apr 29 05:45:09 2003 UTC (8 years, 9 months ago) by imp
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +1 -0 lines
Fix 5 bugs:
	1) always call fxp_stop in fxp_detach.  Since we don't read from
	   the card, there's no need to carefully look at things with
	   bus_child_present.
	2) Call FXP_UNLOCK() before calling bus_teardown_intr to avoid
	   a possible deadlock reported by jhb.
	3) add gone to the softc.  Set it to true in detach.
	4) Return immediately if gone is true in fxp_ioctl
	5) Return immediately if gone is true in fxp_intr

Revision 1.25: download - view: text, markup, annotated - select for diffs
Fri Apr 25 09:01:54 2003 UTC (8 years, 9 months ago) by njl
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +3 -0 lines
Make fxp(4) INTR_MPSAFE (but do not enable MPSAFE just yet):
- Add fxp_start_body() and change fxp_start() to just acquire locks and
  then call fxp_start_body().  Places that would call fxp_start() with
  locks held (mutex recursion) now call fxp_start_body() directly.
  Remove MTX_RECURSE flag from sc_mtx. [gallatin]
- Change fxp_attach() to work without the softc lock, saving interrupt
  hooking until the head of fxp_attach().
- Call ether_ifattach() before overriding ifp parameters. This reverts
  part of 1.155.
- Remove multiple error paths in fxp_attach().
- Teardown interrupt in fxp_detach() before unlocking the softc.
- Make sure mutex is not held in fxp_release()
- Delete the miibus instance and/or self in fxp_release(), not in
  fxp_detach().  This can happen if attach fails partway through.
- Move ifmedia_removeall to fxp_release() since attach may fail after
  media have been allocated.
- Add locking to fxp_suspend, fxp_resume, fxp_start, fxp_intr,
  fxp_poll, fxp_tick, fxp_ioctl, fxp_watchdog.
- Pass in ifp to fxp_intr_body since its callers sometimes already use
  it.
- Add compatibility define for INTR_MPSAFE for 4.x. [gallatin]
- You don't need to bzero softc.

Ideas from:	gallatin, mux
Tested by:	>400M packets of dd/ssh, NFS, ping on i386 UP

Revision 1.24: download - view: text, markup, annotated - select for diffs
Wed Apr 2 16:47:16 2003 UTC (8 years, 10 months ago) by mux
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +54 -9 lines
Convert the fxp(4) driver to the busdma API.

This patch is rather big because I had to significantly redesign
the driver to make the busdma conversion possible.  Most notably,
hardware and software structures were carefully splitted to get
rid of all the structs overlapping evilness.

Special thanks to phk and Richard Puga <puga@mauibuilt.com> for
providing me with fxp(4) hardware to do this work.

Thanks to marcel for testing this on ia64, and to Fred Clift
<fclift@verio.net> for testing this on alpha.

Tested on:	i386, ia64, alpha

Revision 1.23: download - view: text, markup, annotated - select for diffs
Wed Feb 26 22:12:04 2003 UTC (8 years, 11 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +3 -0 lines
As previously threatened, add TCP/IP checksum offload support to
the fxp driver. This is enabled only for the 82550/82551 chips
(PCI revision code 12 or 13). RX and TX checksum offload are
both supported. Transmit offload is limited to TCP and UDP only
right now: there seems to be a problem with IP header checksumming
on transmit in some cases.

This chip has hardware VLAN support as well. I hope to enable
support for this eventually.

Revision 1.17.2.6: download - view: text, markup, annotated - select for diffs
Wed Nov 13 20:58:31 2002 UTC (9 years, 2 months ago) by iedowse
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8, RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.17.2.5: preferred, colored; next MAIN 1.18: preferred, colored
Changes since revision 1.17.2.5: +1 -0 lines
MFC: properly fix the occassional random crash issue that revision
1.142 (1.110.2.26) of if_fxp.c just limited to the DEVICE_POLLING
case.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Thu Nov 7 16:04:07 2002 UTC (9 years, 3 months ago) by iedowse
Branches: MAIN
CVS tags: RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +1 -0 lines
Properly fix the occassional random crash issue that revision 1.142
just limited to the DEVICE_POLLING case. This removes the FXP_RFA_RNRMARK
hack, and replaces it with a softc flag that is used to record when
the handling of a no-resource condition was deferred due to running
out of DEVICE_POLLING cycles. This was tested on -stable, but the
code is essentially the same as in -current. It should only affect
the case where DEVICE_POLLING is defined.

The details of the mechanism behind the crashes are still uncertain
but the most likely cause seems to be some kind of hardware confusion
when the no-resource recovery code is accidentally invoked while
the receiver is still active. This could have happened if the
hardware left the 0x4000 bit of the RFA status word set. The comments
in the commit log for revision 1.142 stating that the driver could
clash with the hardware writing to this status word were not correct.

Tested by:	Guy Helmer <ghelmer@palisadesys.com>

Revision 1.21: download - view: text, markup, annotated - select for diffs
Thu Apr 4 21:03:14 2002 UTC (9 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +1 -1 lines
Change callers of mtx_init() to pass in an appropriate lock type name.  In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64

Revision 1.17.2.5: download - view: text, markup, annotated - select for diffs
Sat Feb 9 23:02:39 2002 UTC (10 years ago) by luigi
Branches: RELENG_4
CVS tags: RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7, 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.17.2.4: preferred, colored
Changes since revision 1.17.2.4: +4 -0 lines
MFC: device polling code for RELENG_4.

Most of the code resides in kern_poll.c, plus device driver
modifications to individual drivers to add the *_poll() handler,
plus mostly one-line changes to a bunch of other files (listed at
the end of this message) to define constants or call the appropriate
functions.

A device_poll(4) manpage is still missing. It should contain an
explaination of what DEVICE_POLLING does, which you can find at

	http://info.iet.unipi.it/~luigi/polling/

To use this facility: add

	options DEVICE_POLLING

to your kernel config file, and at runtime do

	sysctl kern.polling.enable=1

At the moment only the "dc", "fxp" and "sis" drivers have been
modified to make use of this feature. More drivers will be modified
as i have a chance to test them (patches welcome, look at the changes
in the above drivers).

Work supported by: the Xorp Project (www.xorp.org)

sys/kern/kern_poll.c
	the core of the polling procedures
sys/conf/files.i386
	kern/kern_poll.c               optional        device_polling
sys/conf/options.i386
	DEVICE_POLLING		opt_global.h
sys/i386/i386/swtch.s
	hook to poll in the idle loop
sys/i386/i386/trap.c
	hook to poll in traps
sys/i386/include/asnames.h
	#define _idle_poll 			idle_poll
sys/kern/kern_clock.c
	calls to init and periodic poll handlers
sys/net/if.h
	#define	IFF_POLLING	0x10000
sys/net/if_var.h
	prototypes for functions used in device drivers
sys/net/netisr.h
	NETISR_POLL and NETISR_POLLMORE, renumber NETISR_NETGRAPH
	(not objected by julian)
sys/dev/fxp/if_fxp.c
sys/dev/fxp/if_fxpvar.h
sys/pci/if_dc.c
sys/pci/if_dcreg.h
sys/pci/if_sis.c
sys/pci/if_sisreg.h
	device driver modifications

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri Dec 14 17:56:12 2001 UTC (10 years, 1 month ago) by luigi
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +4 -0 lines
Device Polling code for -current.

Non-SMP, i386-only, no polling in the idle loop at the moment.

To use this code you must compile a kernel with

        options DEVICE_POLLING

and at runtime enable polling with

        sysctl kern.polling.enable=1

The percentage of CPU reserved to userland can be set with

        sysctl kern.polling.user_frac=NN (default is 50)

while the remainder is used by polling device drivers and netisr's.
These are the only two variables that you should need to touch. There
are a few more parameters in kern.polling but the default values
are adequate for all purposes. See the code in kern_poll.c for
more details on them.

Polling in the idle loop will be implemented shortly by introducing
a kernel thread which does the job. Until then, the amount of CPU
dedicated to polling will never exceed (100-user_frac).
The equivalent (actually, better) code for -stable is at

	http://info.iet.unipi.it/~luigi/polling/

and also supports polling in the idle loop.

NOTE to Alpha developers:
There is really nothing in this code that is i386-specific.
If you move the 2 lines supporting the new option from
sys/conf/{files,options}.i386 to sys/conf/{files,options} I am
pretty sure that this should work on the Alpha as well, just that
I do not have a suitable test box to try it. If someone feels like
trying it, I would appreciate it.

NOTE to other developers:
sure some things could be done better, and as always I am open to
constructive criticism, which a few of you have already given and
I greatly appreciated.
However, before proposing radical architectural changes, please
take some time to possibly try out this code, or at the very least
read the comments in kern_poll.c, especially re. the reason why I
am using a soft netisr and cannot (I believe) replace it with a
simple timeout.

Quick description of files touched by this commit:

sys/conf/files.i386
        new file kern/kern_poll.c
sys/conf/options.i386
        new option
sys/i386/i386/trap.c
        poll in trap (disabled by default)
sys/kern/kern_clock.c
        initialization and hardclock hooks.
sys/kern/kern_intr.c
        minor swi_net changes
sys/kern/kern_poll.c
        the bulk of the code.
sys/net/if.h
        new flag
sys/net/if_var.h
        declaration for functions used in device drivers.
sys/net/netisr.h
        NETISR_POLL
sys/dev/fxp/if_fxp.c
sys/dev/fxp/if_fxpvar.h
sys/pci/if_dc.c
sys/pci/if_dcreg.h
sys/pci/if_sis.c
sys/pci/if_sisreg.h
        device driver modifications

Revision 1.17.2.4: download - view: text, markup, annotated - select for diffs
Fri Nov 2 16:50:42 2001 UTC (10 years, 3 months ago) by jlemon
Branches: RELENG_4
CVS tags: RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5
Diff to: previous 1.17.2.3: preferred, colored
Changes since revision 1.17.2.3: +24 -4 lines
MFC; sync to -current.  Brings in ucode support, dynamic sysctls, and
     expanded fix for dynamic standby mode.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Thu Oct 25 05:27:25 2001 UTC (10 years, 3 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +24 -4 lines
  . Add structure elements for sysctl.
  . Document default values for microcode

Revision 1.17.2.3: download - view: text, markup, annotated - select for diffs
Fri Jun 8 20:36:58 2001 UTC (10 years, 8 months ago) by jlemon
Branches: RELENG_4
CVS tags: RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4
Diff to: previous 1.17.2.2: preferred, colored
Changes since revision 1.17.2.2: +3 -1 lines
MFC: workaround for 10Mb/s bug.  This may not solve the SCB timeout problem
     on all boards, but is a marked improvement in some cases.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Thu May 17 23:50:24 2001 UTC (10 years, 8 months ago) by jlemon
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2, KSE_MILESTONE_2
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +3 -1 lines
Add workaround for embedded NICs, in particular, the 815E boards.
There appears to be a bug where the chip will lock up when running
in 10Mb/s mode.

Revision 1.17.2.2: download - view: text, markup, annotated - select for diffs
Mon May 14 13:20:28 2001 UTC (10 years, 9 months ago) by jlemon
Branches: RELENG_4
Diff to: previous 1.17.2.1: preferred, colored
Changes since revision 1.17.2.1: +4 -1 lines
Sync to -current, apparently some things got left out in the initial commit:
  o cosmetic style fixes
  o correct 82557/8255{8,9} flow control
  o VLAN support
  o consistency check for miibus
  o additinal register definitions

Revision 1.17.2.1: download - view: text, markup, annotated - select for diffs
Sun May 13 00:09:42 2001 UTC (10 years, 9 months ago) by jlemon
Branches: RELENG_4
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +1 -4 lines
Bring the new fxp driver into -stable

Revision 1.17: download - view: text, markup, annotated - select for diffs
Wed Mar 14 19:50:35 2001 UTC (10 years, 10 months ago) by jlemon
Branches: MAIN
Branch point for: RELENG_4
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +4 -1 lines
Add some performance features to the fxp driver.  If the chip is not
a 82557 (e.g.: a newer chip) then:

   + enable MWI, if the PCI configuration indicates the system supports it
   + enable usage of extended TxCB, for better performance
   + enable hardware flow control.  FC frames will be passed up to the
     host only if promiscuous mode is enabled.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Mar 12 21:30:52 2001 UTC (10 years, 11 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +65 -7 lines
Convert the fxp driver to miibus, which involves ripping out the PHY
logic and media bits.  Support for Intel PHYs can now be found in
dev/mii/inphy.c.

Clean up the driver, and add various 82558 and 82559 specific bits.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Fri Feb 9 06:11:20 2001 UTC (11 years ago) by bmilekic
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +3 -3 lines
Change and clean the mutex lock interface.

mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)

Revision 1.14: download - view: text, markup, annotated - select for diffs
Tue Jan 23 23:22:17 2001 UTC (11 years ago) by mjacob
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +3 -1 lines
Allow fxp to configure in I/O space if the user wants it and specifies
an override as a loader settable variable (fxp_iomap). fxp_iomap is
a bitmap of fxp units that should be configured to use PCI I/O space
in stead of PCI Memory space.

Reviewed by:	Kees Jan Koster <dutchman@tccn.cs.kun.nl>, dg@freebsd.org

Revision 1.9.2.2: download - view: text, markup, annotated - select for diffs
Tue Oct 24 21:47:36 2000 UTC (11 years, 3 months ago) by dg
Branches: old_RELENG_4
CVS tags: old_RELENG_4_2_0_RELEASE
Diff to: previous 1.9.2.1: preferred, colored; branchpoint 1.9: preferred, colored; next MAIN 1.10: preferred, colored
Changes since revision 1.9.2.1: +7 -1 lines
Brought in suspend/resume changes from -current. Revs 1.88 and 1.91.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Mon Sep 18 21:12:19 2000 UTC (11 years, 4 months ago) by dg
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +4 -31 lines
Removed NetBSD support, which bit-rotted long ago.
Changed new SMP locking macros given the new situation.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sun Sep 17 22:12:12 2000 UTC (11 years, 4 months ago) by dg
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +7 -1 lines
Added support for APM suspend/resume.

PR:		18756
Submitted by:	mike ryan <msr@elision.org>, with modifications by me.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Sun Sep 17 13:26:25 2000 UTC (11 years, 4 months ago) by cp
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +8 -1 lines
Add locking to make able to run without the Giant lock being held. This
is enabling as all entries are still called with Giant being held.
Maintaining compatability with NetBSD makes what should be very simple
kinda ugly.

Reviewed by:	Jason Evans

Revision 1.6.2.2: download - view: text, markup, annotated - select for diffs
Sat Apr 1 19:04:22 2000 UTC (11 years, 10 months ago) by dg
Branches: old_RELENG_3
CVS tags: old_RELENG_3_5_0_RELEASE
Diff to: previous 1.6.2.1: preferred, colored; branchpoint 1.6: preferred, colored; next MAIN 1.7: preferred, colored
Changes since revision 1.6.2.1: +2 -1 lines
Merged changes from rev 1.78 (if_fxp.c) and 1.10 (if_fxpvar.h): fixes
to support certain larger SEEPROMs.

Revision 1.9.2.1: download - view: text, markup, annotated - select for diffs
Wed Mar 29 02:02:39 2000 UTC (11 years, 10 months ago) by dg
Branches: old_RELENG_4
CVS tags: old_RELENG_4_1_1_RELEASE, old_RELENG_4_1_0_RELEASE
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -1 lines
Merged changes from rev 1.78 (if_fxp.c) and 1.10 (if_fxpvar.h): fixes
to support certain larger SEEPROMs.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Tue Mar 28 04:41:42 2000 UTC (11 years, 10 months ago) by dg
Branches: MAIN
CVS tags: old_PRE_SMPNG
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -1 lines
Added support for cards and on-motherboard NICs that use an SEEPROM
address size that is different than the standard 6bits. This fixes
support for the Compaq NC3121 card, certain newer Intel Pro/100+
cards, and should also fix integrated NICs on SuperMicro and Compaq
motherboards.
The auto-sizing algorithm was taken from NetBSD (thanks!), which I
think got it from Linux originally.
Thanks also to Andrew Sparrow <spadger@best.com> and Joe Moore
<jomor@ahpcns.com> for supplying me with unworking Compaq and Intel
cards to develop and test the fixes with.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Thu Sep 30 19:03:12 1999 UTC (12 years, 4 months ago) by gallatin
Branches: MAIN
CVS tags: old_RELENG_4_BP, old_RELENG_4_0_0_RELEASE
Branch point for: old_RELENG_4
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +3 -19 lines
Make the fxp driver work on alpha, rather than panic the machine on boot
and/or when using the card.

o Convert the driver to using bus_space.  This allows alphas with
fxp's to boot, rather than panic'ing because rman_get_virtual()
doesn't really return a virtual address on alphas.

o Fix an alpha unaligned access error caused by some misfeature of
gcc/egcs: if link_addr & rbd_addr in the fxp_rfa struct are 32 bit
quantities, egcs will assume they are naturally aligned. So it will do
a ldl & some shifty/masky to twiddle 16 bit values in fxp_lwcopy().
However, if they are 16-bit aligned, the ldl will actually be done on
a 16-bit aligned value & we will panic with an unaligned access
error... Changing their definition to an array of chars seems to fix
this.  I obtained this from NetBSD.

I've tested this on both i386 & alpha.

Revision 1.3.2.2: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:21:08 1999 UTC (12 years, 5 months ago) by peter
Branches: old_RELENG_2_2
Diff to: previous 1.3.2.1: preferred, colored; next MAIN 1.4: preferred, colored
Changes since revision 1.3.2.1: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.6.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 29 16:31:38 1999 UTC (12 years, 5 months ago) by peter
Branches: old_RELENG_3
CVS tags: old_RELENG_3_4_0_RELEASE, old_RELENG_3_3_0_RELEASE
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:50:51 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.7: download - view: text, markup, annotated - select for diffs
Fri Apr 16 21:22:51 1999 UTC (12 years, 9 months ago) by peter
Branches: MAIN
CVS tags: old_PRE_VFS_BIO_NFS_PATCH, old_PRE_SMP_VMSHARE, old_POST_VFS_BIO_NFS_PATCH, old_POST_SMP_VMSHARE, old_POST_NEWBUS
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +4 -1 lines
Bring the 'new-bus' to the i386.  This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition.  eisa, isapnp and pccard* are
not yet using the new resource manager.  Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
 ATA driver to the Alpha.  Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by:	core

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sun Aug 2 00:29:15 1998 UTC (13 years, 6 months ago) by dg
Branches: MAIN
CVS tags: old_RELENG_3_BP, old_RELENG_3_2_PAO_BP, old_RELENG_3_2_PAO, old_RELENG_3_2_0_RELEASE, old_RELENG_3_1_0_RELEASE, old_RELENG_3_0_0_RELEASE, old_PRE_NEWBUS
Branch point for: old_RELENG_3
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +10 -8 lines
Reordered fxp_softc for optimal cacheline behavior.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sun Jun 7 17:12:38 1998 UTC (13 years, 8 months ago) by dfr
Branches: MAIN
CVS tags: old_PRE_NOBDEV
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -2 lines
This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Nov 29 08:11:01 1997 UTC (14 years, 2 months ago) by davidg
Branches: MAIN
CVS tags: old_PRE_SOFTUPDATE, old_PRE_DEVFS_SLICE, old_POST_SOFTUPDATE, old_POST_DEVFS_SLICE
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +6 -6 lines
Shuffle things a bit for better cacheline behavior.

Revision 1.3.2.1: download - view: text, markup, annotated - select for diffs
Tue Sep 30 16:42:57 1997 UTC (14 years, 4 months ago) by davidg
Branches: old_RELENG_2_2
CVS tags: old_RELENG_2_2_8_RELEASE, old_RELENG_2_2_7_RELEASE, old_RELENG_2_2_6_RELEASE, old_RELENG_2_2_5_RELEASE
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +1 -2 lines
Oops, I missed the change to this file when merging in the new driver
from -current.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Mon Sep 29 11:27:43 1997 UTC (14 years, 4 months ago) by davidg
Branches: MAIN
Branch point for: old_RELENG_2_2
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +5 -1 lines
Work around a bug in the 82557 NIC where the receiver will lock up
if it is in 10Mbps mode and gets certain types of garbage prior to
the packet header. The work-around involves reprogramming the
multicast filter if nothing is received in some number of seconds
(currently set at 15). As a side effect, implemented complete support
for multicasting rather than the previous 'receive all multicasts'
hack, since we now have the ability to program the filter table.
Fixed a serious bug which crept in with the timeout() changes;
the cookie was only saved on the first timeout() call in fxp_init()
and wasn't updated in the most common place in fxp_stats_update()
when the timeout was rescheduled. This bug would have resulted in
an eventual panic if fxp_stop() was called (which happens when any
interface flags are changed, for example).
Fixed a bug in Alpha support that would have caused the TxCB
descriptor chain to span a page boundry, causing serious problems
if the pages didn't happen to be contiguous.
Removed some gratuitous bit masking that was left over from an
older implementation.
Fixed a bug where too much was copied from the configuration
template, spilling over into memory that followed it.
Fixed handling of if_timer...it was cleared too early in some cases.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Sep 21 22:02:09 1997 UTC (14 years, 4 months ago) by gibbs
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2 -1 lines
Update for new callout interface.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Fri Sep 5 10:23:58 1997 UTC (14 years, 5 months ago) by davidg
Branches: MAIN
Changes to support NetBSD and the new ifmedia extensions.
Submitted by:	Jason Thorpe <thorpej@netbsd.org>

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