1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> 4 5<book id="Z85230Guide"> 6 <bookinfo> 7 <title>Z8530 Programming Guide</title> 8 9 <authorgroup> 10 <author> 11 <firstname>Alan</firstname> 12 <surname>Cox</surname> 13 <affiliation> 14 <address> 15 <email>alan@lxorguk.ukuu.org.uk</email> 16 </address> 17 </affiliation> 18 </author> 19 </authorgroup> 20 21 <copyright> 22 <year>2000</year> 23 <holder>Alan Cox</holder> 24 </copyright> 25 26 <legalnotice> 27 <para> 28 This documentation is free software; you can redistribute 29 it and/or modify it under the terms of the GNU General Public 30 License as published by the Free Software Foundation; either 31 version 2 of the License, or (at your option) any later 32 version. 33 </para> 34 35 <para> 36 This program is distributed in the hope that it will be 37 useful, but WITHOUT ANY WARRANTY; without even the implied 38 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 39 See the GNU General Public License for more details. 40 </para> 41 42 <para> 43 You should have received a copy of the GNU General Public 44 License along with this program; if not, write to the Free 45 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 46 MA 02111-1307 USA 47 </para> 48 49 <para> 50 For more details see the file COPYING in the source 51 distribution of Linux. 52 </para> 53 </legalnotice> 54 </bookinfo> 55 56<toc></toc> 57 58 <chapter id="intro"> 59 <title>Introduction</title> 60 <para> 61 The Z85x30 family synchronous/asynchronous controller chips are 62 used on a large number of cheap network interface cards. The 63 kernel provides a core interface layer that is designed to make 64 it easy to provide WAN services using this chip. 65 </para> 66 <para> 67 The current driver only support synchronous operation. Merging the 68 asynchronous driver support into this code to allow any Z85x30 69 device to be used as both a tty interface and as a synchronous 70 controller is a project for Linux post the 2.4 release 71 </para> 72 </chapter> 73 74 <chapter id="Driver_Modes"> 75 <title>Driver Modes</title> 76 <para> 77 The Z85230 driver layer can drive Z8530, Z85C30 and Z85230 devices 78 in three different modes. Each mode can be applied to an individual 79 channel on the chip (each chip has two channels). 80 </para> 81 <para> 82 The PIO synchronous mode supports the most common Z8530 wiring. Here 83 the chip is interface to the I/O and interrupt facilities of the 84 host machine but not to the DMA subsystem. When running PIO the 85 Z8530 has extremely tight timing requirements. Doing high speeds, 86 even with a Z85230 will be tricky. Typically you should expect to 87 achieve at best 9600 baud with a Z8C530 and 64Kbits with a Z85230. 88 </para> 89 <para> 90 The DMA mode supports the chip when it is configured to use dual DMA 91 channels on an ISA bus. The better cards tend to support this mode 92 of operation for a single channel. With DMA running the Z85230 tops 93 out when it starts to hit ISA DMA constraints at about 512Kbits. It 94 is worth noting here that many PC machines hang or crash when the 95 chip is driven fast enough to hold the ISA bus solid. 96 </para> 97 <para> 98 Transmit DMA mode uses a single DMA channel. The DMA channel is used 99 for transmission as the transmit FIFO is smaller than the receive 100 FIFO. it gives better performance than pure PIO mode but is nowhere 101 near as ideal as pure DMA mode. 102 </para> 103 </chapter> 104 105 <chapter id="Using_the_Z85230_driver"> 106 <title>Using the Z85230 driver</title> 107 <para> 108 The Z85230 driver provides the back end interface to your board. To 109 configure a Z8530 interface you need to detect the board and to 110 identify its ports and interrupt resources. It is also your problem 111 to verify the resources are available. 112 </para> 113 <para> 114 Having identified the chip you need to fill in a struct z8530_dev, 115 which describes each chip. This object must exist until you finally 116 shutdown the board. Firstly zero the active field. This ensures 117 nothing goes off without you intending it. The irq field should 118 be set to the interrupt number of the chip. (Each chip has a single 119 interrupt source rather than each channel). You are responsible 120 for allocating the interrupt line. The interrupt handler should be 121 set to <function>z8530_interrupt</function>. The device id should 122 be set to the z8530_dev structure pointer. Whether the interrupt can 123 be shared or not is board dependent, and up to you to initialise. 124 </para> 125 <para> 126 The structure holds two channel structures. 127 Initialise chanA.ctrlio and chanA.dataio with the address of the 128 control and data ports. You can or this with Z8530_PORT_SLEEP to 129 indicate your interface needs the 5uS delay for chip settling done 130 in software. The PORT_SLEEP option is architecture specific. Other 131 flags may become available on future platforms, eg for MMIO. 132 Initialise the chanA.irqs to &z8530_nop to start the chip up 133 as disabled and discarding interrupt events. This ensures that 134 stray interrupts will be mopped up and not hang the bus. Set 135 chanA.dev to point to the device structure itself. The 136 private and name field you may use as you wish. The private field 137 is unused by the Z85230 layer. The name is used for error reporting 138 and it may thus make sense to make it match the network name. 139 </para> 140 <para> 141 Repeat the same operation with the B channel if your chip has 142 both channels wired to something useful. This isn't always the 143 case. If it is not wired then the I/O values do not matter, but 144 you must initialise chanB.dev. 145 </para> 146 <para> 147 If your board has DMA facilities then initialise the txdma and 148 rxdma fields for the relevant channels. You must also allocate the 149 ISA DMA channels and do any necessary board level initialisation 150 to configure them. The low level driver will do the Z8530 and 151 DMA controller programming but not board specific magic. 152 </para> 153 <para> 154 Having initialised the device you can then call 155 <function>z8530_init</function>. This will probe the chip and 156 reset it into a known state. An identification sequence is then 157 run to identify the chip type. If the checks fail to pass the 158 function returns a non zero error code. Typically this indicates 159 that the port given is not valid. After this call the 160 type field of the z8530_dev structure is initialised to either 161 Z8530, Z85C30 or Z85230 according to the chip found. 162 </para> 163 <para> 164 Once you have called z8530_init you can also make use of the utility 165 function <function>z8530_describe</function>. This provides a 166 consistent reporting format for the Z8530 devices, and allows all 167 the drivers to provide consistent reporting. 168 </para> 169 </chapter> 170 171 <chapter id="Attaching_Network_Interfaces"> 172 <title>Attaching Network Interfaces</title> 173 <para> 174 If you wish to use the network interface facilities of the driver, 175 then you need to attach a network device to each channel that is 176 present and in use. In addition to use the generic HDLC 177 you need to follow some additional plumbing rules. They may seem 178 complex but a look at the example hostess_sv11 driver should 179 reassure you. 180 </para> 181 <para> 182 The network device used for each channel should be pointed to by 183 the netdevice field of each channel. The hdlc-> priv field of the 184 network device points to your private data - you will need to be 185 able to find your private data from this. 186 </para> 187 <para> 188 The way most drivers approach this particular problem is to 189 create a structure holding the Z8530 device definition and 190 put that into the private field of the network device. The 191 network device fields of the channels then point back to the 192 network devices. 193 </para> 194 <para> 195 If you wish to use the generic HDLC then you need to register 196 the HDLC device. 197 </para> 198 <para> 199 Before you register your network device you will also need to 200 provide suitable handlers for most of the network device callbacks. 201 See the network device documentation for more details on this. 202 </para> 203 </chapter> 204 205 <chapter id="Configuring_And_Activating_The_Port"> 206 <title>Configuring And Activating The Port</title> 207 <para> 208 The Z85230 driver provides helper functions and tables to load the 209 port registers on the Z8530 chips. When programming the register 210 settings for a channel be aware that the documentation recommends 211 initialisation orders. Strange things happen when these are not 212 followed. 213 </para> 214 <para> 215 <function>z8530_channel_load</function> takes an array of 216 pairs of initialisation values in an array of u8 type. The first 217 value is the Z8530 register number. Add 16 to indicate the alternate 218 register bank on the later chips. The array is terminated by a 255. 219 </para> 220 <para> 221 The driver provides a pair of public tables. The 222 z8530_hdlc_kilostream table is for the UK 'Kilostream' service and 223 also happens to cover most other end host configurations. The 224 z8530_hdlc_kilostream_85230 table is the same configuration using 225 the enhancements of the 85230 chip. The configuration loaded is 226 standard NRZ encoded synchronous data with HDLC bitstuffing. All 227 of the timing is taken from the other end of the link. 228 </para> 229 <para> 230 When writing your own tables be aware that the driver internally 231 tracks register values. It may need to reload values. You should 232 therefore be sure to set registers 1-7, 9-11, 14 and 15 in all 233 configurations. Where the register settings depend on DMA selection 234 the driver will update the bits itself when you open or close. 235 Loading a new table with the interface open is not recommended. 236 </para> 237 <para> 238 There are three standard configurations supported by the core 239 code. In PIO mode the interface is programmed up to use 240 interrupt driven PIO. This places high demands on the host processor 241 to avoid latency. The driver is written to take account of latency 242 issues but it cannot avoid latencies caused by other drivers, 243 notably IDE in PIO mode. Because the drivers allocate buffers you 244 must also prevent MTU changes while the port is open. 245 </para> 246 <para> 247 Once the port is open it will call the rx_function of each channel 248 whenever a completed packet arrived. This is invoked from 249 interrupt context and passes you the channel and a network 250 buffer (struct sk_buff) holding the data. The data includes 251 the CRC bytes so most users will want to trim the last two 252 bytes before processing the data. This function is very timing 253 critical. When you wish to simply discard data the support 254 code provides the function <function>z8530_null_rx</function> 255 to discard the data. 256 </para> 257 <para> 258 To active PIO mode sending and receiving the <function> 259 z8530_sync_open</function> is called. This expects to be passed 260 the network device and the channel. Typically this is called from 261 your network device open callback. On a failure a non zero error 262 status is returned. The <function>z8530_sync_close</function> 263 function shuts down a PIO channel. This must be done before the 264 channel is opened again and before the driver shuts down 265 and unloads. 266 </para> 267 <para> 268 The ideal mode of operation is dual channel DMA mode. Here the 269 kernel driver will configure the board for DMA in both directions. 270 The driver also handles ISA DMA issues such as controller 271 programming and the memory range limit for you. This mode is 272 activated by calling the <function>z8530_sync_dma_open</function> 273 function. On failure a non zero error value is returned. 274 Once this mode is activated it can be shut down by calling the 275 <function>z8530_sync_dma_close</function>. You must call the close 276 function matching the open mode you used. 277 </para> 278 <para> 279 The final supported mode uses a single DMA channel to drive the 280 transmit side. As the Z85C30 has a larger FIFO on the receive 281 channel this tends to increase the maximum speed a little. 282 This is activated by calling the <function>z8530_sync_txdma_open 283 </function>. This returns a non zero error code on failure. The 284 <function>z8530_sync_txdma_close</function> function closes down 285 the Z8530 interface from this mode. 286 </para> 287 </chapter> 288 289 <chapter id="Network_Layer_Functions"> 290 <title>Network Layer Functions</title> 291 <para> 292 The Z8530 layer provides functions to queue packets for 293 transmission. The driver internally buffers the frame currently 294 being transmitted and one further frame (in order to keep back 295 to back transmission running). Any further buffering is up to 296 the caller. 297 </para> 298 <para> 299 The function <function>z8530_queue_xmit</function> takes a network 300 buffer in sk_buff format and queues it for transmission. The 301 caller must provide the entire packet with the exception of the 302 bitstuffing and CRC. This is normally done by the caller via 303 the generic HDLC interface layer. It returns 0 if the buffer has been 304 queued and non zero values for queue full. If the function accepts 305 the buffer it becomes property of the Z8530 layer and the caller 306 should not free it. 307 </para> 308 <para> 309 The function <function>z8530_get_stats</function> returns a pointer 310 to an internally maintained per interface statistics block. This 311 provides most of the interface code needed to implement the network 312 layer get_stats callback. 313 </para> 314 </chapter> 315 316 <chapter id="Porting_The_Z8530_Driver"> 317 <title>Porting The Z8530 Driver</title> 318 <para> 319 The Z8530 driver is written to be portable. In DMA mode it makes 320 assumptions about the use of ISA DMA. These are probably warranted 321 in most cases as the Z85230 in particular was designed to glue to PC 322 type machines. The PIO mode makes no real assumptions. 323 </para> 324 <para> 325 Should you need to retarget the Z8530 driver to another architecture 326 the only code that should need changing are the port I/O functions. 327 At the moment these assume PC I/O port accesses. This may not be 328 appropriate for all platforms. Replacing 329 <function>z8530_read_port</function> and <function>z8530_write_port 330 </function> is intended to be all that is required to port this 331 driver layer. 332 </para> 333 </chapter> 334 335 <chapter id="bugs"> 336 <title>Known Bugs And Assumptions</title> 337 <para> 338 <variablelist> 339 <varlistentry><term>Interrupt Locking</term> 340 <listitem> 341 <para> 342 The locking in the driver is done via the global cli/sti lock. This 343 makes for relatively poor SMP performance. Switching this to use a 344 per device spin lock would probably materially improve performance. 345 </para> 346 </listitem></varlistentry> 347 348 <varlistentry><term>Occasional Failures</term> 349 <listitem> 350 <para> 351 We have reports of occasional failures when run for very long 352 periods of time and the driver starts to receive junk frames. At 353 the moment the cause of this is not clear. 354 </para> 355 </listitem></varlistentry> 356 </variablelist> 357 358 </para> 359 </chapter> 360 361 <chapter id="pubfunctions"> 362 <title>Public Functions Provided</title> 363<!-- drivers/net/wan/z85230.c --> 364<refentry id="API-z8530-interrupt"> 365<refentryinfo> 366 <title>LINUX</title> 367 <productname>Kernel Hackers Manual</productname> 368 <date>July 2017</date> 369</refentryinfo> 370<refmeta> 371 <refentrytitle><phrase>z8530_interrupt</phrase></refentrytitle> 372 <manvolnum>9</manvolnum> 373 <refmiscinfo class="version">4.1.27</refmiscinfo> 374</refmeta> 375<refnamediv> 376 <refname>z8530_interrupt</refname> 377 <refpurpose> 378 Handle an interrupt from a Z8530 379 </refpurpose> 380</refnamediv> 381<refsynopsisdiv> 382 <title>Synopsis</title> 383 <funcsynopsis><funcprototype> 384 <funcdef>irqreturn_t <function>z8530_interrupt </function></funcdef> 385 <paramdef>int <parameter>irq</parameter></paramdef> 386 <paramdef>void * <parameter>dev_id</parameter></paramdef> 387 </funcprototype></funcsynopsis> 388</refsynopsisdiv> 389<refsect1> 390 <title>Arguments</title> 391 <variablelist> 392 <varlistentry> 393 <term><parameter>irq</parameter></term> 394 <listitem> 395 <para> 396 Interrupt number 397 </para> 398 </listitem> 399 </varlistentry> 400 <varlistentry> 401 <term><parameter>dev_id</parameter></term> 402 <listitem> 403 <para> 404 The Z8530 device that is interrupting. 405 </para> 406 </listitem> 407 </varlistentry> 408 </variablelist> 409</refsect1> 410<refsect1> 411<title>Description</title> 412<para> 413 A Z85[2]30 device has stuck its hand in the air for attention. 414 We scan both the channels on the chip for events and then call 415 the channel specific call backs for each channel that has events. 416 We have to use callback functions because the two channels can be 417 in different modes. 418 </para><para> 419 420 Locking is done for the handlers. Note that locking is done 421 at the chip level (the 5uS delay issue is per chip not per 422 channel). c->lock for both channels points to dev->lock 423</para> 424</refsect1> 425</refentry> 426 427<refentry id="API-z8530-sync-open"> 428<refentryinfo> 429 <title>LINUX</title> 430 <productname>Kernel Hackers Manual</productname> 431 <date>July 2017</date> 432</refentryinfo> 433<refmeta> 434 <refentrytitle><phrase>z8530_sync_open</phrase></refentrytitle> 435 <manvolnum>9</manvolnum> 436 <refmiscinfo class="version">4.1.27</refmiscinfo> 437</refmeta> 438<refnamediv> 439 <refname>z8530_sync_open</refname> 440 <refpurpose> 441 Open a Z8530 channel for PIO 442 </refpurpose> 443</refnamediv> 444<refsynopsisdiv> 445 <title>Synopsis</title> 446 <funcsynopsis><funcprototype> 447 <funcdef>int <function>z8530_sync_open </function></funcdef> 448 <paramdef>struct net_device * <parameter>dev</parameter></paramdef> 449 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 450 </funcprototype></funcsynopsis> 451</refsynopsisdiv> 452<refsect1> 453 <title>Arguments</title> 454 <variablelist> 455 <varlistentry> 456 <term><parameter>dev</parameter></term> 457 <listitem> 458 <para> 459 The network interface we are using 460 </para> 461 </listitem> 462 </varlistentry> 463 <varlistentry> 464 <term><parameter>c</parameter></term> 465 <listitem> 466 <para> 467 The Z8530 channel to open in synchronous PIO mode 468 </para> 469 </listitem> 470 </varlistentry> 471 </variablelist> 472</refsect1> 473<refsect1> 474<title>Description</title> 475<para> 476 Switch a Z8530 into synchronous mode without DMA assist. We 477 raise the RTS/DTR and commence network operation. 478</para> 479</refsect1> 480</refentry> 481 482<refentry id="API-z8530-sync-close"> 483<refentryinfo> 484 <title>LINUX</title> 485 <productname>Kernel Hackers Manual</productname> 486 <date>July 2017</date> 487</refentryinfo> 488<refmeta> 489 <refentrytitle><phrase>z8530_sync_close</phrase></refentrytitle> 490 <manvolnum>9</manvolnum> 491 <refmiscinfo class="version">4.1.27</refmiscinfo> 492</refmeta> 493<refnamediv> 494 <refname>z8530_sync_close</refname> 495 <refpurpose> 496 Close a PIO Z8530 channel 497 </refpurpose> 498</refnamediv> 499<refsynopsisdiv> 500 <title>Synopsis</title> 501 <funcsynopsis><funcprototype> 502 <funcdef>int <function>z8530_sync_close </function></funcdef> 503 <paramdef>struct net_device * <parameter>dev</parameter></paramdef> 504 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 505 </funcprototype></funcsynopsis> 506</refsynopsisdiv> 507<refsect1> 508 <title>Arguments</title> 509 <variablelist> 510 <varlistentry> 511 <term><parameter>dev</parameter></term> 512 <listitem> 513 <para> 514 Network device to close 515 </para> 516 </listitem> 517 </varlistentry> 518 <varlistentry> 519 <term><parameter>c</parameter></term> 520 <listitem> 521 <para> 522 Z8530 channel to disassociate and move to idle 523 </para> 524 </listitem> 525 </varlistentry> 526 </variablelist> 527</refsect1> 528<refsect1> 529<title>Description</title> 530<para> 531 Close down a Z8530 interface and switch its interrupt handlers 532 to discard future events. 533</para> 534</refsect1> 535</refentry> 536 537<refentry id="API-z8530-sync-dma-open"> 538<refentryinfo> 539 <title>LINUX</title> 540 <productname>Kernel Hackers Manual</productname> 541 <date>July 2017</date> 542</refentryinfo> 543<refmeta> 544 <refentrytitle><phrase>z8530_sync_dma_open</phrase></refentrytitle> 545 <manvolnum>9</manvolnum> 546 <refmiscinfo class="version">4.1.27</refmiscinfo> 547</refmeta> 548<refnamediv> 549 <refname>z8530_sync_dma_open</refname> 550 <refpurpose> 551 Open a Z8530 for DMA I/O 552 </refpurpose> 553</refnamediv> 554<refsynopsisdiv> 555 <title>Synopsis</title> 556 <funcsynopsis><funcprototype> 557 <funcdef>int <function>z8530_sync_dma_open </function></funcdef> 558 <paramdef>struct net_device * <parameter>dev</parameter></paramdef> 559 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 560 </funcprototype></funcsynopsis> 561</refsynopsisdiv> 562<refsect1> 563 <title>Arguments</title> 564 <variablelist> 565 <varlistentry> 566 <term><parameter>dev</parameter></term> 567 <listitem> 568 <para> 569 The network device to attach 570 </para> 571 </listitem> 572 </varlistentry> 573 <varlistentry> 574 <term><parameter>c</parameter></term> 575 <listitem> 576 <para> 577 The Z8530 channel to configure in sync DMA mode. 578 </para> 579 </listitem> 580 </varlistentry> 581 </variablelist> 582</refsect1> 583<refsect1> 584<title>Description</title> 585<para> 586 Set up a Z85x30 device for synchronous DMA in both directions. Two 587 ISA DMA channels must be available for this to work. We assume ISA 588 DMA driven I/O and PC limits on access. 589</para> 590</refsect1> 591</refentry> 592 593<refentry id="API-z8530-sync-dma-close"> 594<refentryinfo> 595 <title>LINUX</title> 596 <productname>Kernel Hackers Manual</productname> 597 <date>July 2017</date> 598</refentryinfo> 599<refmeta> 600 <refentrytitle><phrase>z8530_sync_dma_close</phrase></refentrytitle> 601 <manvolnum>9</manvolnum> 602 <refmiscinfo class="version">4.1.27</refmiscinfo> 603</refmeta> 604<refnamediv> 605 <refname>z8530_sync_dma_close</refname> 606 <refpurpose> 607 Close down DMA I/O 608 </refpurpose> 609</refnamediv> 610<refsynopsisdiv> 611 <title>Synopsis</title> 612 <funcsynopsis><funcprototype> 613 <funcdef>int <function>z8530_sync_dma_close </function></funcdef> 614 <paramdef>struct net_device * <parameter>dev</parameter></paramdef> 615 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 616 </funcprototype></funcsynopsis> 617</refsynopsisdiv> 618<refsect1> 619 <title>Arguments</title> 620 <variablelist> 621 <varlistentry> 622 <term><parameter>dev</parameter></term> 623 <listitem> 624 <para> 625 Network device to detach 626 </para> 627 </listitem> 628 </varlistentry> 629 <varlistentry> 630 <term><parameter>c</parameter></term> 631 <listitem> 632 <para> 633 Z8530 channel to move into discard mode 634 </para> 635 </listitem> 636 </varlistentry> 637 </variablelist> 638</refsect1> 639<refsect1> 640<title>Description</title> 641<para> 642 Shut down a DMA mode synchronous interface. Halt the DMA, and 643 free the buffers. 644</para> 645</refsect1> 646</refentry> 647 648<refentry id="API-z8530-sync-txdma-open"> 649<refentryinfo> 650 <title>LINUX</title> 651 <productname>Kernel Hackers Manual</productname> 652 <date>July 2017</date> 653</refentryinfo> 654<refmeta> 655 <refentrytitle><phrase>z8530_sync_txdma_open</phrase></refentrytitle> 656 <manvolnum>9</manvolnum> 657 <refmiscinfo class="version">4.1.27</refmiscinfo> 658</refmeta> 659<refnamediv> 660 <refname>z8530_sync_txdma_open</refname> 661 <refpurpose> 662 Open a Z8530 for TX driven DMA 663 </refpurpose> 664</refnamediv> 665<refsynopsisdiv> 666 <title>Synopsis</title> 667 <funcsynopsis><funcprototype> 668 <funcdef>int <function>z8530_sync_txdma_open </function></funcdef> 669 <paramdef>struct net_device * <parameter>dev</parameter></paramdef> 670 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 671 </funcprototype></funcsynopsis> 672</refsynopsisdiv> 673<refsect1> 674 <title>Arguments</title> 675 <variablelist> 676 <varlistentry> 677 <term><parameter>dev</parameter></term> 678 <listitem> 679 <para> 680 The network device to attach 681 </para> 682 </listitem> 683 </varlistentry> 684 <varlistentry> 685 <term><parameter>c</parameter></term> 686 <listitem> 687 <para> 688 The Z8530 channel to configure in sync DMA mode. 689 </para> 690 </listitem> 691 </varlistentry> 692 </variablelist> 693</refsect1> 694<refsect1> 695<title>Description</title> 696<para> 697 Set up a Z85x30 device for synchronous DMA tranmission. One 698 ISA DMA channel must be available for this to work. The receive 699 side is run in PIO mode, but then it has the bigger FIFO. 700</para> 701</refsect1> 702</refentry> 703 704<refentry id="API-z8530-sync-txdma-close"> 705<refentryinfo> 706 <title>LINUX</title> 707 <productname>Kernel Hackers Manual</productname> 708 <date>July 2017</date> 709</refentryinfo> 710<refmeta> 711 <refentrytitle><phrase>z8530_sync_txdma_close</phrase></refentrytitle> 712 <manvolnum>9</manvolnum> 713 <refmiscinfo class="version">4.1.27</refmiscinfo> 714</refmeta> 715<refnamediv> 716 <refname>z8530_sync_txdma_close</refname> 717 <refpurpose> 718 Close down a TX driven DMA channel 719 </refpurpose> 720</refnamediv> 721<refsynopsisdiv> 722 <title>Synopsis</title> 723 <funcsynopsis><funcprototype> 724 <funcdef>int <function>z8530_sync_txdma_close </function></funcdef> 725 <paramdef>struct net_device * <parameter>dev</parameter></paramdef> 726 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 727 </funcprototype></funcsynopsis> 728</refsynopsisdiv> 729<refsect1> 730 <title>Arguments</title> 731 <variablelist> 732 <varlistentry> 733 <term><parameter>dev</parameter></term> 734 <listitem> 735 <para> 736 Network device to detach 737 </para> 738 </listitem> 739 </varlistentry> 740 <varlistentry> 741 <term><parameter>c</parameter></term> 742 <listitem> 743 <para> 744 Z8530 channel to move into discard mode 745 </para> 746 </listitem> 747 </varlistentry> 748 </variablelist> 749</refsect1> 750<refsect1> 751<title>Description</title> 752<para> 753 Shut down a DMA/PIO split mode synchronous interface. Halt the DMA, 754 and free the buffers. 755</para> 756</refsect1> 757</refentry> 758 759<refentry id="API-z8530-describe"> 760<refentryinfo> 761 <title>LINUX</title> 762 <productname>Kernel Hackers Manual</productname> 763 <date>July 2017</date> 764</refentryinfo> 765<refmeta> 766 <refentrytitle><phrase>z8530_describe</phrase></refentrytitle> 767 <manvolnum>9</manvolnum> 768 <refmiscinfo class="version">4.1.27</refmiscinfo> 769</refmeta> 770<refnamediv> 771 <refname>z8530_describe</refname> 772 <refpurpose> 773 Uniformly describe a Z8530 port 774 </refpurpose> 775</refnamediv> 776<refsynopsisdiv> 777 <title>Synopsis</title> 778 <funcsynopsis><funcprototype> 779 <funcdef>void <function>z8530_describe </function></funcdef> 780 <paramdef>struct z8530_dev * <parameter>dev</parameter></paramdef> 781 <paramdef>char * <parameter>mapping</parameter></paramdef> 782 <paramdef>unsigned long <parameter>io</parameter></paramdef> 783 </funcprototype></funcsynopsis> 784</refsynopsisdiv> 785<refsect1> 786 <title>Arguments</title> 787 <variablelist> 788 <varlistentry> 789 <term><parameter>dev</parameter></term> 790 <listitem> 791 <para> 792 Z8530 device to describe 793 </para> 794 </listitem> 795 </varlistentry> 796 <varlistentry> 797 <term><parameter>mapping</parameter></term> 798 <listitem> 799 <para> 800 string holding mapping type (eg <quote>I/O</quote> or <quote>Mem</quote>) 801 </para> 802 </listitem> 803 </varlistentry> 804 <varlistentry> 805 <term><parameter>io</parameter></term> 806 <listitem> 807 <para> 808 the port value in question 809 </para> 810 </listitem> 811 </varlistentry> 812 </variablelist> 813</refsect1> 814<refsect1> 815<title>Description</title> 816<para> 817 Describe a Z8530 in a standard format. We must pass the I/O as 818 the port offset isn't predictable. The main reason for this function 819 is to try and get a common format of report. 820</para> 821</refsect1> 822</refentry> 823 824<refentry id="API-z8530-init"> 825<refentryinfo> 826 <title>LINUX</title> 827 <productname>Kernel Hackers Manual</productname> 828 <date>July 2017</date> 829</refentryinfo> 830<refmeta> 831 <refentrytitle><phrase>z8530_init</phrase></refentrytitle> 832 <manvolnum>9</manvolnum> 833 <refmiscinfo class="version">4.1.27</refmiscinfo> 834</refmeta> 835<refnamediv> 836 <refname>z8530_init</refname> 837 <refpurpose> 838 Initialise a Z8530 device 839 </refpurpose> 840</refnamediv> 841<refsynopsisdiv> 842 <title>Synopsis</title> 843 <funcsynopsis><funcprototype> 844 <funcdef>int <function>z8530_init </function></funcdef> 845 <paramdef>struct z8530_dev * <parameter>dev</parameter></paramdef> 846 </funcprototype></funcsynopsis> 847</refsynopsisdiv> 848<refsect1> 849 <title>Arguments</title> 850 <variablelist> 851 <varlistentry> 852 <term><parameter>dev</parameter></term> 853 <listitem> 854 <para> 855 Z8530 device to initialise. 856 </para> 857 </listitem> 858 </varlistentry> 859 </variablelist> 860</refsect1> 861<refsect1> 862<title>Description</title> 863<para> 864 Configure up a Z8530/Z85C30 or Z85230 chip. We check the device 865 is present, identify the type and then program it to hopefully 866 keep quite and behave. This matters a lot, a Z8530 in the wrong 867 state will sometimes get into stupid modes generating 10Khz 868 interrupt streams and the like. 869 </para><para> 870 871 We set the interrupt handler up to discard any events, in case 872 we get them during reset or setp. 873 </para><para> 874 875 Return 0 for success, or a negative value indicating the problem 876 in errno form. 877</para> 878</refsect1> 879</refentry> 880 881<refentry id="API-z8530-shutdown"> 882<refentryinfo> 883 <title>LINUX</title> 884 <productname>Kernel Hackers Manual</productname> 885 <date>July 2017</date> 886</refentryinfo> 887<refmeta> 888 <refentrytitle><phrase>z8530_shutdown</phrase></refentrytitle> 889 <manvolnum>9</manvolnum> 890 <refmiscinfo class="version">4.1.27</refmiscinfo> 891</refmeta> 892<refnamediv> 893 <refname>z8530_shutdown</refname> 894 <refpurpose> 895 Shutdown a Z8530 device 896 </refpurpose> 897</refnamediv> 898<refsynopsisdiv> 899 <title>Synopsis</title> 900 <funcsynopsis><funcprototype> 901 <funcdef>int <function>z8530_shutdown </function></funcdef> 902 <paramdef>struct z8530_dev * <parameter>dev</parameter></paramdef> 903 </funcprototype></funcsynopsis> 904</refsynopsisdiv> 905<refsect1> 906 <title>Arguments</title> 907 <variablelist> 908 <varlistentry> 909 <term><parameter>dev</parameter></term> 910 <listitem> 911 <para> 912 The Z8530 chip to shutdown 913 </para> 914 </listitem> 915 </varlistentry> 916 </variablelist> 917</refsect1> 918<refsect1> 919<title>Description</title> 920<para> 921 We set the interrupt handlers to silence any interrupts. We then 922 reset the chip and wait 100uS to be sure the reset completed. Just 923 in case the caller then tries to do stuff. 924 </para><para> 925 926 This is called without the lock held 927</para> 928</refsect1> 929</refentry> 930 931<refentry id="API-z8530-channel-load"> 932<refentryinfo> 933 <title>LINUX</title> 934 <productname>Kernel Hackers Manual</productname> 935 <date>July 2017</date> 936</refentryinfo> 937<refmeta> 938 <refentrytitle><phrase>z8530_channel_load</phrase></refentrytitle> 939 <manvolnum>9</manvolnum> 940 <refmiscinfo class="version">4.1.27</refmiscinfo> 941</refmeta> 942<refnamediv> 943 <refname>z8530_channel_load</refname> 944 <refpurpose> 945 Load channel data 946 </refpurpose> 947</refnamediv> 948<refsynopsisdiv> 949 <title>Synopsis</title> 950 <funcsynopsis><funcprototype> 951 <funcdef>int <function>z8530_channel_load </function></funcdef> 952 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 953 <paramdef>u8 * <parameter>rtable</parameter></paramdef> 954 </funcprototype></funcsynopsis> 955</refsynopsisdiv> 956<refsect1> 957 <title>Arguments</title> 958 <variablelist> 959 <varlistentry> 960 <term><parameter>c</parameter></term> 961 <listitem> 962 <para> 963 Z8530 channel to configure 964 </para> 965 </listitem> 966 </varlistentry> 967 <varlistentry> 968 <term><parameter>rtable</parameter></term> 969 <listitem> 970 <para> 971 table of register, value pairs 972 </para> 973 </listitem> 974 </varlistentry> 975 </variablelist> 976</refsect1> 977<refsect1> 978<title>FIXME</title> 979<para> 980 ioctl to allow user uploaded tables 981 </para><para> 982 983 Load a Z8530 channel up from the system data. We use +16 to 984 indicate the <quote>prime</quote> registers. The value 255 terminates the 985 table. 986</para> 987</refsect1> 988</refentry> 989 990<refentry id="API-z8530-null-rx"> 991<refentryinfo> 992 <title>LINUX</title> 993 <productname>Kernel Hackers Manual</productname> 994 <date>July 2017</date> 995</refentryinfo> 996<refmeta> 997 <refentrytitle><phrase>z8530_null_rx</phrase></refentrytitle> 998 <manvolnum>9</manvolnum> 999 <refmiscinfo class="version">4.1.27</refmiscinfo> 1000</refmeta> 1001<refnamediv> 1002 <refname>z8530_null_rx</refname> 1003 <refpurpose> 1004 Discard a packet 1005 </refpurpose> 1006</refnamediv> 1007<refsynopsisdiv> 1008 <title>Synopsis</title> 1009 <funcsynopsis><funcprototype> 1010 <funcdef>void <function>z8530_null_rx </function></funcdef> 1011 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1012 <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef> 1013 </funcprototype></funcsynopsis> 1014</refsynopsisdiv> 1015<refsect1> 1016 <title>Arguments</title> 1017 <variablelist> 1018 <varlistentry> 1019 <term><parameter>c</parameter></term> 1020 <listitem> 1021 <para> 1022 The channel the packet arrived on 1023 </para> 1024 </listitem> 1025 </varlistentry> 1026 <varlistentry> 1027 <term><parameter>skb</parameter></term> 1028 <listitem> 1029 <para> 1030 The buffer 1031 </para> 1032 </listitem> 1033 </varlistentry> 1034 </variablelist> 1035</refsect1> 1036<refsect1> 1037<title>Description</title> 1038<para> 1039 We point the receive handler at this function when idle. Instead 1040 of processing the frames we get to throw them away. 1041</para> 1042</refsect1> 1043</refentry> 1044 1045<refentry id="API-z8530-queue-xmit"> 1046<refentryinfo> 1047 <title>LINUX</title> 1048 <productname>Kernel Hackers Manual</productname> 1049 <date>July 2017</date> 1050</refentryinfo> 1051<refmeta> 1052 <refentrytitle><phrase>z8530_queue_xmit</phrase></refentrytitle> 1053 <manvolnum>9</manvolnum> 1054 <refmiscinfo class="version">4.1.27</refmiscinfo> 1055</refmeta> 1056<refnamediv> 1057 <refname>z8530_queue_xmit</refname> 1058 <refpurpose> 1059 Queue a packet 1060 </refpurpose> 1061</refnamediv> 1062<refsynopsisdiv> 1063 <title>Synopsis</title> 1064 <funcsynopsis><funcprototype> 1065 <funcdef>netdev_tx_t <function>z8530_queue_xmit </function></funcdef> 1066 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1067 <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef> 1068 </funcprototype></funcsynopsis> 1069</refsynopsisdiv> 1070<refsect1> 1071 <title>Arguments</title> 1072 <variablelist> 1073 <varlistentry> 1074 <term><parameter>c</parameter></term> 1075 <listitem> 1076 <para> 1077 The channel to use 1078 </para> 1079 </listitem> 1080 </varlistentry> 1081 <varlistentry> 1082 <term><parameter>skb</parameter></term> 1083 <listitem> 1084 <para> 1085 The packet to kick down the channel 1086 </para> 1087 </listitem> 1088 </varlistentry> 1089 </variablelist> 1090</refsect1> 1091<refsect1> 1092<title>Description</title> 1093<para> 1094 Queue a packet for transmission. Because we have rather 1095 hard to hit interrupt latencies for the Z85230 per packet 1096 even in DMA mode we do the flip to DMA buffer if needed here 1097 not in the IRQ. 1098 </para><para> 1099 1100 Called from the network code. The lock is not held at this 1101 point. 1102</para> 1103</refsect1> 1104</refentry> 1105 1106 </chapter> 1107 1108 <chapter id="intfunctions"> 1109 <title>Internal Functions</title> 1110<!-- drivers/net/wan/z85230.c --> 1111<refentry id="API-z8530-read-port"> 1112<refentryinfo> 1113 <title>LINUX</title> 1114 <productname>Kernel Hackers Manual</productname> 1115 <date>July 2017</date> 1116</refentryinfo> 1117<refmeta> 1118 <refentrytitle><phrase>z8530_read_port</phrase></refentrytitle> 1119 <manvolnum>9</manvolnum> 1120 <refmiscinfo class="version">4.1.27</refmiscinfo> 1121</refmeta> 1122<refnamediv> 1123 <refname>z8530_read_port</refname> 1124 <refpurpose> 1125 Architecture specific interface function 1126 </refpurpose> 1127</refnamediv> 1128<refsynopsisdiv> 1129 <title>Synopsis</title> 1130 <funcsynopsis><funcprototype> 1131 <funcdef>int <function>z8530_read_port </function></funcdef> 1132 <paramdef>unsigned long <parameter>p</parameter></paramdef> 1133 </funcprototype></funcsynopsis> 1134</refsynopsisdiv> 1135<refsect1> 1136 <title>Arguments</title> 1137 <variablelist> 1138 <varlistentry> 1139 <term><parameter>p</parameter></term> 1140 <listitem> 1141 <para> 1142 port to read 1143 </para> 1144 </listitem> 1145 </varlistentry> 1146 </variablelist> 1147</refsect1> 1148<refsect1> 1149<title>Description</title> 1150<para> 1151 Provided port access methods. The Comtrol SV11 requires no delays 1152 between accesses and uses PC I/O. Some drivers may need a 5uS delay 1153 </para><para> 1154 1155 In the longer term this should become an architecture specific 1156 section so that this can become a generic driver interface for all 1157 platforms. For now we only handle PC I/O ports with or without the 1158 dread 5uS sanity delay. 1159 </para><para> 1160 1161 The caller must hold sufficient locks to avoid violating the horrible 1162 5uS delay rule. 1163</para> 1164</refsect1> 1165</refentry> 1166 1167<refentry id="API-z8530-write-port"> 1168<refentryinfo> 1169 <title>LINUX</title> 1170 <productname>Kernel Hackers Manual</productname> 1171 <date>July 2017</date> 1172</refentryinfo> 1173<refmeta> 1174 <refentrytitle><phrase>z8530_write_port</phrase></refentrytitle> 1175 <manvolnum>9</manvolnum> 1176 <refmiscinfo class="version">4.1.27</refmiscinfo> 1177</refmeta> 1178<refnamediv> 1179 <refname>z8530_write_port</refname> 1180 <refpurpose> 1181 Architecture specific interface function 1182 </refpurpose> 1183</refnamediv> 1184<refsynopsisdiv> 1185 <title>Synopsis</title> 1186 <funcsynopsis><funcprototype> 1187 <funcdef>void <function>z8530_write_port </function></funcdef> 1188 <paramdef>unsigned long <parameter>p</parameter></paramdef> 1189 <paramdef>u8 <parameter>d</parameter></paramdef> 1190 </funcprototype></funcsynopsis> 1191</refsynopsisdiv> 1192<refsect1> 1193 <title>Arguments</title> 1194 <variablelist> 1195 <varlistentry> 1196 <term><parameter>p</parameter></term> 1197 <listitem> 1198 <para> 1199 port to write 1200 </para> 1201 </listitem> 1202 </varlistentry> 1203 <varlistentry> 1204 <term><parameter>d</parameter></term> 1205 <listitem> 1206 <para> 1207 value to write 1208 </para> 1209 </listitem> 1210 </varlistentry> 1211 </variablelist> 1212</refsect1> 1213<refsect1> 1214<title>Description</title> 1215<para> 1216 Write a value to a port with delays if need be. Note that the 1217 caller must hold locks to avoid read/writes from other contexts 1218 violating the 5uS rule 1219 </para><para> 1220 1221 In the longer term this should become an architecture specific 1222 section so that this can become a generic driver interface for all 1223 platforms. For now we only handle PC I/O ports with or without the 1224 dread 5uS sanity delay. 1225</para> 1226</refsect1> 1227</refentry> 1228 1229<refentry id="API-read-zsreg"> 1230<refentryinfo> 1231 <title>LINUX</title> 1232 <productname>Kernel Hackers Manual</productname> 1233 <date>July 2017</date> 1234</refentryinfo> 1235<refmeta> 1236 <refentrytitle><phrase>read_zsreg</phrase></refentrytitle> 1237 <manvolnum>9</manvolnum> 1238 <refmiscinfo class="version">4.1.27</refmiscinfo> 1239</refmeta> 1240<refnamediv> 1241 <refname>read_zsreg</refname> 1242 <refpurpose> 1243 Read a register from a Z85230 1244 </refpurpose> 1245</refnamediv> 1246<refsynopsisdiv> 1247 <title>Synopsis</title> 1248 <funcsynopsis><funcprototype> 1249 <funcdef>u8 <function>read_zsreg </function></funcdef> 1250 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1251 <paramdef>u8 <parameter>reg</parameter></paramdef> 1252 </funcprototype></funcsynopsis> 1253</refsynopsisdiv> 1254<refsect1> 1255 <title>Arguments</title> 1256 <variablelist> 1257 <varlistentry> 1258 <term><parameter>c</parameter></term> 1259 <listitem> 1260 <para> 1261 Z8530 channel to read from (2 per chip) 1262 </para> 1263 </listitem> 1264 </varlistentry> 1265 <varlistentry> 1266 <term><parameter>reg</parameter></term> 1267 <listitem> 1268 <para> 1269 Register to read 1270 </para> 1271 </listitem> 1272 </varlistentry> 1273 </variablelist> 1274</refsect1> 1275<refsect1> 1276<title>FIXME</title> 1277<para> 1278 Use a spinlock. 1279 </para><para> 1280 1281 Most of the Z8530 registers are indexed off the control registers. 1282 A read is done by writing to the control register and reading the 1283 register back. The caller must hold the lock 1284</para> 1285</refsect1> 1286</refentry> 1287 1288<refentry id="API-read-zsdata"> 1289<refentryinfo> 1290 <title>LINUX</title> 1291 <productname>Kernel Hackers Manual</productname> 1292 <date>July 2017</date> 1293</refentryinfo> 1294<refmeta> 1295 <refentrytitle><phrase>read_zsdata</phrase></refentrytitle> 1296 <manvolnum>9</manvolnum> 1297 <refmiscinfo class="version">4.1.27</refmiscinfo> 1298</refmeta> 1299<refnamediv> 1300 <refname>read_zsdata</refname> 1301 <refpurpose> 1302 Read the data port of a Z8530 channel 1303 </refpurpose> 1304</refnamediv> 1305<refsynopsisdiv> 1306 <title>Synopsis</title> 1307 <funcsynopsis><funcprototype> 1308 <funcdef>u8 <function>read_zsdata </function></funcdef> 1309 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1310 </funcprototype></funcsynopsis> 1311</refsynopsisdiv> 1312<refsect1> 1313 <title>Arguments</title> 1314 <variablelist> 1315 <varlistentry> 1316 <term><parameter>c</parameter></term> 1317 <listitem> 1318 <para> 1319 The Z8530 channel to read the data port from 1320 </para> 1321 </listitem> 1322 </varlistentry> 1323 </variablelist> 1324</refsect1> 1325<refsect1> 1326<title>Description</title> 1327<para> 1328 The data port provides fast access to some things. We still 1329 have all the 5uS delays to worry about. 1330</para> 1331</refsect1> 1332</refentry> 1333 1334<refentry id="API-write-zsreg"> 1335<refentryinfo> 1336 <title>LINUX</title> 1337 <productname>Kernel Hackers Manual</productname> 1338 <date>July 2017</date> 1339</refentryinfo> 1340<refmeta> 1341 <refentrytitle><phrase>write_zsreg</phrase></refentrytitle> 1342 <manvolnum>9</manvolnum> 1343 <refmiscinfo class="version">4.1.27</refmiscinfo> 1344</refmeta> 1345<refnamediv> 1346 <refname>write_zsreg</refname> 1347 <refpurpose> 1348 Write to a Z8530 channel register 1349 </refpurpose> 1350</refnamediv> 1351<refsynopsisdiv> 1352 <title>Synopsis</title> 1353 <funcsynopsis><funcprototype> 1354 <funcdef>void <function>write_zsreg </function></funcdef> 1355 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1356 <paramdef>u8 <parameter>reg</parameter></paramdef> 1357 <paramdef>u8 <parameter>val</parameter></paramdef> 1358 </funcprototype></funcsynopsis> 1359</refsynopsisdiv> 1360<refsect1> 1361 <title>Arguments</title> 1362 <variablelist> 1363 <varlistentry> 1364 <term><parameter>c</parameter></term> 1365 <listitem> 1366 <para> 1367 The Z8530 channel 1368 </para> 1369 </listitem> 1370 </varlistentry> 1371 <varlistentry> 1372 <term><parameter>reg</parameter></term> 1373 <listitem> 1374 <para> 1375 Register number 1376 </para> 1377 </listitem> 1378 </varlistentry> 1379 <varlistentry> 1380 <term><parameter>val</parameter></term> 1381 <listitem> 1382 <para> 1383 Value to write 1384 </para> 1385 </listitem> 1386 </varlistentry> 1387 </variablelist> 1388</refsect1> 1389<refsect1> 1390<title>Description</title> 1391<para> 1392 Write a value to an indexed register. The caller must hold the lock 1393 to honour the irritating delay rules. We know about register 0 1394 being fast to access. 1395 </para><para> 1396 1397 Assumes c->lock is held. 1398</para> 1399</refsect1> 1400</refentry> 1401 1402<refentry id="API-write-zsctrl"> 1403<refentryinfo> 1404 <title>LINUX</title> 1405 <productname>Kernel Hackers Manual</productname> 1406 <date>July 2017</date> 1407</refentryinfo> 1408<refmeta> 1409 <refentrytitle><phrase>write_zsctrl</phrase></refentrytitle> 1410 <manvolnum>9</manvolnum> 1411 <refmiscinfo class="version">4.1.27</refmiscinfo> 1412</refmeta> 1413<refnamediv> 1414 <refname>write_zsctrl</refname> 1415 <refpurpose> 1416 Write to a Z8530 control register 1417 </refpurpose> 1418</refnamediv> 1419<refsynopsisdiv> 1420 <title>Synopsis</title> 1421 <funcsynopsis><funcprototype> 1422 <funcdef>void <function>write_zsctrl </function></funcdef> 1423 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1424 <paramdef>u8 <parameter>val</parameter></paramdef> 1425 </funcprototype></funcsynopsis> 1426</refsynopsisdiv> 1427<refsect1> 1428 <title>Arguments</title> 1429 <variablelist> 1430 <varlistentry> 1431 <term><parameter>c</parameter></term> 1432 <listitem> 1433 <para> 1434 The Z8530 channel 1435 </para> 1436 </listitem> 1437 </varlistentry> 1438 <varlistentry> 1439 <term><parameter>val</parameter></term> 1440 <listitem> 1441 <para> 1442 Value to write 1443 </para> 1444 </listitem> 1445 </varlistentry> 1446 </variablelist> 1447</refsect1> 1448<refsect1> 1449<title>Description</title> 1450<para> 1451 Write directly to the control register on the Z8530 1452</para> 1453</refsect1> 1454</refentry> 1455 1456<refentry id="API-write-zsdata"> 1457<refentryinfo> 1458 <title>LINUX</title> 1459 <productname>Kernel Hackers Manual</productname> 1460 <date>July 2017</date> 1461</refentryinfo> 1462<refmeta> 1463 <refentrytitle><phrase>write_zsdata</phrase></refentrytitle> 1464 <manvolnum>9</manvolnum> 1465 <refmiscinfo class="version">4.1.27</refmiscinfo> 1466</refmeta> 1467<refnamediv> 1468 <refname>write_zsdata</refname> 1469 <refpurpose> 1470 Write to a Z8530 control register 1471 </refpurpose> 1472</refnamediv> 1473<refsynopsisdiv> 1474 <title>Synopsis</title> 1475 <funcsynopsis><funcprototype> 1476 <funcdef>void <function>write_zsdata </function></funcdef> 1477 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1478 <paramdef>u8 <parameter>val</parameter></paramdef> 1479 </funcprototype></funcsynopsis> 1480</refsynopsisdiv> 1481<refsect1> 1482 <title>Arguments</title> 1483 <variablelist> 1484 <varlistentry> 1485 <term><parameter>c</parameter></term> 1486 <listitem> 1487 <para> 1488 The Z8530 channel 1489 </para> 1490 </listitem> 1491 </varlistentry> 1492 <varlistentry> 1493 <term><parameter>val</parameter></term> 1494 <listitem> 1495 <para> 1496 Value to write 1497 </para> 1498 </listitem> 1499 </varlistentry> 1500 </variablelist> 1501</refsect1> 1502<refsect1> 1503<title>Description</title> 1504<para> 1505 Write directly to the data register on the Z8530 1506</para> 1507</refsect1> 1508</refentry> 1509 1510<refentry id="API-z8530-flush-fifo"> 1511<refentryinfo> 1512 <title>LINUX</title> 1513 <productname>Kernel Hackers Manual</productname> 1514 <date>July 2017</date> 1515</refentryinfo> 1516<refmeta> 1517 <refentrytitle><phrase>z8530_flush_fifo</phrase></refentrytitle> 1518 <manvolnum>9</manvolnum> 1519 <refmiscinfo class="version">4.1.27</refmiscinfo> 1520</refmeta> 1521<refnamediv> 1522 <refname>z8530_flush_fifo</refname> 1523 <refpurpose> 1524 Flush on chip RX FIFO 1525 </refpurpose> 1526</refnamediv> 1527<refsynopsisdiv> 1528 <title>Synopsis</title> 1529 <funcsynopsis><funcprototype> 1530 <funcdef>void <function>z8530_flush_fifo </function></funcdef> 1531 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1532 </funcprototype></funcsynopsis> 1533</refsynopsisdiv> 1534<refsect1> 1535 <title>Arguments</title> 1536 <variablelist> 1537 <varlistentry> 1538 <term><parameter>c</parameter></term> 1539 <listitem> 1540 <para> 1541 Channel to flush 1542 </para> 1543 </listitem> 1544 </varlistentry> 1545 </variablelist> 1546</refsect1> 1547<refsect1> 1548<title>Description</title> 1549<para> 1550 Flush the receive FIFO. There is no specific option for this, we 1551 blindly read bytes and discard them. Reading when there is no data 1552 is harmless. The 8530 has a 4 byte FIFO, the 85230 has 8 bytes. 1553 </para><para> 1554 1555 All locking is handled for the caller. On return data may still be 1556 present if it arrived during the flush. 1557</para> 1558</refsect1> 1559</refentry> 1560 1561<refentry id="API-z8530-rtsdtr"> 1562<refentryinfo> 1563 <title>LINUX</title> 1564 <productname>Kernel Hackers Manual</productname> 1565 <date>July 2017</date> 1566</refentryinfo> 1567<refmeta> 1568 <refentrytitle><phrase>z8530_rtsdtr</phrase></refentrytitle> 1569 <manvolnum>9</manvolnum> 1570 <refmiscinfo class="version">4.1.27</refmiscinfo> 1571</refmeta> 1572<refnamediv> 1573 <refname>z8530_rtsdtr</refname> 1574 <refpurpose> 1575 Control the outgoing DTS/RTS line 1576 </refpurpose> 1577</refnamediv> 1578<refsynopsisdiv> 1579 <title>Synopsis</title> 1580 <funcsynopsis><funcprototype> 1581 <funcdef>void <function>z8530_rtsdtr </function></funcdef> 1582 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1583 <paramdef>int <parameter>set</parameter></paramdef> 1584 </funcprototype></funcsynopsis> 1585</refsynopsisdiv> 1586<refsect1> 1587 <title>Arguments</title> 1588 <variablelist> 1589 <varlistentry> 1590 <term><parameter>c</parameter></term> 1591 <listitem> 1592 <para> 1593 The Z8530 channel to control; 1594 </para> 1595 </listitem> 1596 </varlistentry> 1597 <varlistentry> 1598 <term><parameter>set</parameter></term> 1599 <listitem> 1600 <para> 1601 1 to set, 0 to clear 1602 </para> 1603 </listitem> 1604 </varlistentry> 1605 </variablelist> 1606</refsect1> 1607<refsect1> 1608<title>Description</title> 1609<para> 1610 Sets or clears DTR/RTS on the requested line. All locking is handled 1611 by the caller. For now we assume all boards use the actual RTS/DTR 1612 on the chip. Apparently one or two don't. We'll scream about them 1613 later. 1614</para> 1615</refsect1> 1616</refentry> 1617 1618<refentry id="API-z8530-rx"> 1619<refentryinfo> 1620 <title>LINUX</title> 1621 <productname>Kernel Hackers Manual</productname> 1622 <date>July 2017</date> 1623</refentryinfo> 1624<refmeta> 1625 <refentrytitle><phrase>z8530_rx</phrase></refentrytitle> 1626 <manvolnum>9</manvolnum> 1627 <refmiscinfo class="version">4.1.27</refmiscinfo> 1628</refmeta> 1629<refnamediv> 1630 <refname>z8530_rx</refname> 1631 <refpurpose> 1632 Handle a PIO receive event 1633 </refpurpose> 1634</refnamediv> 1635<refsynopsisdiv> 1636 <title>Synopsis</title> 1637 <funcsynopsis><funcprototype> 1638 <funcdef>void <function>z8530_rx </function></funcdef> 1639 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1640 </funcprototype></funcsynopsis> 1641</refsynopsisdiv> 1642<refsect1> 1643 <title>Arguments</title> 1644 <variablelist> 1645 <varlistentry> 1646 <term><parameter>c</parameter></term> 1647 <listitem> 1648 <para> 1649 Z8530 channel to process 1650 </para> 1651 </listitem> 1652 </varlistentry> 1653 </variablelist> 1654</refsect1> 1655<refsect1> 1656<title>Description</title> 1657<para> 1658 Receive handler for receiving in PIO mode. This is much like the 1659 async one but not quite the same or as complex 1660</para> 1661</refsect1> 1662<refsect1> 1663<title>Note</title> 1664<para> 1665 Its intended that this handler can easily be separated from 1666 the main code to run realtime. That'll be needed for some machines 1667 (eg to ever clock 64kbits on a sparc ;)). 1668 </para><para> 1669 1670 The RT_LOCK macros don't do anything now. Keep the code covered 1671 by them as short as possible in all circumstances - clocks cost 1672 baud. The interrupt handler is assumed to be atomic w.r.t. to 1673 other code - this is true in the RT case too. 1674 </para><para> 1675 1676 We only cover the sync cases for this. If you want 2Mbit async 1677 do it yourself but consider medical assistance first. This non DMA 1678 synchronous mode is portable code. The DMA mode assumes PCI like 1679 ISA DMA 1680 </para><para> 1681 1682 Called with the device lock held 1683</para> 1684</refsect1> 1685</refentry> 1686 1687<refentry id="API-z8530-tx"> 1688<refentryinfo> 1689 <title>LINUX</title> 1690 <productname>Kernel Hackers Manual</productname> 1691 <date>July 2017</date> 1692</refentryinfo> 1693<refmeta> 1694 <refentrytitle><phrase>z8530_tx</phrase></refentrytitle> 1695 <manvolnum>9</manvolnum> 1696 <refmiscinfo class="version">4.1.27</refmiscinfo> 1697</refmeta> 1698<refnamediv> 1699 <refname>z8530_tx</refname> 1700 <refpurpose> 1701 Handle a PIO transmit event 1702 </refpurpose> 1703</refnamediv> 1704<refsynopsisdiv> 1705 <title>Synopsis</title> 1706 <funcsynopsis><funcprototype> 1707 <funcdef>void <function>z8530_tx </function></funcdef> 1708 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1709 </funcprototype></funcsynopsis> 1710</refsynopsisdiv> 1711<refsect1> 1712 <title>Arguments</title> 1713 <variablelist> 1714 <varlistentry> 1715 <term><parameter>c</parameter></term> 1716 <listitem> 1717 <para> 1718 Z8530 channel to process 1719 </para> 1720 </listitem> 1721 </varlistentry> 1722 </variablelist> 1723</refsect1> 1724<refsect1> 1725<title>Description</title> 1726<para> 1727 Z8530 transmit interrupt handler for the PIO mode. The basic 1728 idea is to attempt to keep the FIFO fed. We fill as many bytes 1729 in as possible, its quite possible that we won't keep up with the 1730 data rate otherwise. 1731</para> 1732</refsect1> 1733</refentry> 1734 1735<refentry id="API-z8530-status"> 1736<refentryinfo> 1737 <title>LINUX</title> 1738 <productname>Kernel Hackers Manual</productname> 1739 <date>July 2017</date> 1740</refentryinfo> 1741<refmeta> 1742 <refentrytitle><phrase>z8530_status</phrase></refentrytitle> 1743 <manvolnum>9</manvolnum> 1744 <refmiscinfo class="version">4.1.27</refmiscinfo> 1745</refmeta> 1746<refnamediv> 1747 <refname>z8530_status</refname> 1748 <refpurpose> 1749 Handle a PIO status exception 1750 </refpurpose> 1751</refnamediv> 1752<refsynopsisdiv> 1753 <title>Synopsis</title> 1754 <funcsynopsis><funcprototype> 1755 <funcdef>void <function>z8530_status </function></funcdef> 1756 <paramdef>struct z8530_channel * <parameter>chan</parameter></paramdef> 1757 </funcprototype></funcsynopsis> 1758</refsynopsisdiv> 1759<refsect1> 1760 <title>Arguments</title> 1761 <variablelist> 1762 <varlistentry> 1763 <term><parameter>chan</parameter></term> 1764 <listitem> 1765 <para> 1766 Z8530 channel to process 1767 </para> 1768 </listitem> 1769 </varlistentry> 1770 </variablelist> 1771</refsect1> 1772<refsect1> 1773<title>Description</title> 1774<para> 1775 A status event occurred in PIO synchronous mode. There are several 1776 reasons the chip will bother us here. A transmit underrun means we 1777 failed to feed the chip fast enough and just broke a packet. A DCD 1778 change is a line up or down. 1779</para> 1780</refsect1> 1781</refentry> 1782 1783<refentry id="API-z8530-dma-rx"> 1784<refentryinfo> 1785 <title>LINUX</title> 1786 <productname>Kernel Hackers Manual</productname> 1787 <date>July 2017</date> 1788</refentryinfo> 1789<refmeta> 1790 <refentrytitle><phrase>z8530_dma_rx</phrase></refentrytitle> 1791 <manvolnum>9</manvolnum> 1792 <refmiscinfo class="version">4.1.27</refmiscinfo> 1793</refmeta> 1794<refnamediv> 1795 <refname>z8530_dma_rx</refname> 1796 <refpurpose> 1797 Handle a DMA RX event 1798 </refpurpose> 1799</refnamediv> 1800<refsynopsisdiv> 1801 <title>Synopsis</title> 1802 <funcsynopsis><funcprototype> 1803 <funcdef>void <function>z8530_dma_rx </function></funcdef> 1804 <paramdef>struct z8530_channel * <parameter>chan</parameter></paramdef> 1805 </funcprototype></funcsynopsis> 1806</refsynopsisdiv> 1807<refsect1> 1808 <title>Arguments</title> 1809 <variablelist> 1810 <varlistentry> 1811 <term><parameter>chan</parameter></term> 1812 <listitem> 1813 <para> 1814 Channel to handle 1815 </para> 1816 </listitem> 1817 </varlistentry> 1818 </variablelist> 1819</refsect1> 1820<refsect1> 1821<title>Description</title> 1822<para> 1823 Non bus mastering DMA interfaces for the Z8x30 devices. This 1824 is really pretty PC specific. The DMA mode means that most receive 1825 events are handled by the DMA hardware. We get a kick here only if 1826 a frame ended. 1827</para> 1828</refsect1> 1829</refentry> 1830 1831<refentry id="API-z8530-dma-tx"> 1832<refentryinfo> 1833 <title>LINUX</title> 1834 <productname>Kernel Hackers Manual</productname> 1835 <date>July 2017</date> 1836</refentryinfo> 1837<refmeta> 1838 <refentrytitle><phrase>z8530_dma_tx</phrase></refentrytitle> 1839 <manvolnum>9</manvolnum> 1840 <refmiscinfo class="version">4.1.27</refmiscinfo> 1841</refmeta> 1842<refnamediv> 1843 <refname>z8530_dma_tx</refname> 1844 <refpurpose> 1845 Handle a DMA TX event 1846 </refpurpose> 1847</refnamediv> 1848<refsynopsisdiv> 1849 <title>Synopsis</title> 1850 <funcsynopsis><funcprototype> 1851 <funcdef>void <function>z8530_dma_tx </function></funcdef> 1852 <paramdef>struct z8530_channel * <parameter>chan</parameter></paramdef> 1853 </funcprototype></funcsynopsis> 1854</refsynopsisdiv> 1855<refsect1> 1856 <title>Arguments</title> 1857 <variablelist> 1858 <varlistentry> 1859 <term><parameter>chan</parameter></term> 1860 <listitem> 1861 <para> 1862 The Z8530 channel to handle 1863 </para> 1864 </listitem> 1865 </varlistentry> 1866 </variablelist> 1867</refsect1> 1868<refsect1> 1869<title>Description</title> 1870<para> 1871 We have received an interrupt while doing DMA transmissions. It 1872 shouldn't happen. Scream loudly if it does. 1873</para> 1874</refsect1> 1875</refentry> 1876 1877<refentry id="API-z8530-dma-status"> 1878<refentryinfo> 1879 <title>LINUX</title> 1880 <productname>Kernel Hackers Manual</productname> 1881 <date>July 2017</date> 1882</refentryinfo> 1883<refmeta> 1884 <refentrytitle><phrase>z8530_dma_status</phrase></refentrytitle> 1885 <manvolnum>9</manvolnum> 1886 <refmiscinfo class="version">4.1.27</refmiscinfo> 1887</refmeta> 1888<refnamediv> 1889 <refname>z8530_dma_status</refname> 1890 <refpurpose> 1891 Handle a DMA status exception 1892 </refpurpose> 1893</refnamediv> 1894<refsynopsisdiv> 1895 <title>Synopsis</title> 1896 <funcsynopsis><funcprototype> 1897 <funcdef>void <function>z8530_dma_status </function></funcdef> 1898 <paramdef>struct z8530_channel * <parameter>chan</parameter></paramdef> 1899 </funcprototype></funcsynopsis> 1900</refsynopsisdiv> 1901<refsect1> 1902 <title>Arguments</title> 1903 <variablelist> 1904 <varlistentry> 1905 <term><parameter>chan</parameter></term> 1906 <listitem> 1907 <para> 1908 Z8530 channel to process 1909 </para><para> 1910 1911 A status event occurred on the Z8530. We receive these for two reasons 1912 when in DMA mode. Firstly if we finished a packet transfer we get one 1913 and kick the next packet out. Secondly we may see a DCD change. 1914 </para> 1915 </listitem> 1916 </varlistentry> 1917 </variablelist> 1918</refsect1> 1919</refentry> 1920 1921<refentry id="API-z8530-rx-clear"> 1922<refentryinfo> 1923 <title>LINUX</title> 1924 <productname>Kernel Hackers Manual</productname> 1925 <date>July 2017</date> 1926</refentryinfo> 1927<refmeta> 1928 <refentrytitle><phrase>z8530_rx_clear</phrase></refentrytitle> 1929 <manvolnum>9</manvolnum> 1930 <refmiscinfo class="version">4.1.27</refmiscinfo> 1931</refmeta> 1932<refnamediv> 1933 <refname>z8530_rx_clear</refname> 1934 <refpurpose> 1935 Handle RX events from a stopped chip 1936 </refpurpose> 1937</refnamediv> 1938<refsynopsisdiv> 1939 <title>Synopsis</title> 1940 <funcsynopsis><funcprototype> 1941 <funcdef>void <function>z8530_rx_clear </function></funcdef> 1942 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1943 </funcprototype></funcsynopsis> 1944</refsynopsisdiv> 1945<refsect1> 1946 <title>Arguments</title> 1947 <variablelist> 1948 <varlistentry> 1949 <term><parameter>c</parameter></term> 1950 <listitem> 1951 <para> 1952 Z8530 channel to shut up 1953 </para> 1954 </listitem> 1955 </varlistentry> 1956 </variablelist> 1957</refsect1> 1958<refsect1> 1959<title>Description</title> 1960<para> 1961 Receive interrupt vectors for a Z8530 that is in 'parked' mode. 1962 For machines with PCI Z85x30 cards, or level triggered interrupts 1963 (eg the MacII) we must clear the interrupt cause or die. 1964</para> 1965</refsect1> 1966</refentry> 1967 1968<refentry id="API-z8530-tx-clear"> 1969<refentryinfo> 1970 <title>LINUX</title> 1971 <productname>Kernel Hackers Manual</productname> 1972 <date>July 2017</date> 1973</refentryinfo> 1974<refmeta> 1975 <refentrytitle><phrase>z8530_tx_clear</phrase></refentrytitle> 1976 <manvolnum>9</manvolnum> 1977 <refmiscinfo class="version">4.1.27</refmiscinfo> 1978</refmeta> 1979<refnamediv> 1980 <refname>z8530_tx_clear</refname> 1981 <refpurpose> 1982 Handle TX events from a stopped chip 1983 </refpurpose> 1984</refnamediv> 1985<refsynopsisdiv> 1986 <title>Synopsis</title> 1987 <funcsynopsis><funcprototype> 1988 <funcdef>void <function>z8530_tx_clear </function></funcdef> 1989 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 1990 </funcprototype></funcsynopsis> 1991</refsynopsisdiv> 1992<refsect1> 1993 <title>Arguments</title> 1994 <variablelist> 1995 <varlistentry> 1996 <term><parameter>c</parameter></term> 1997 <listitem> 1998 <para> 1999 Z8530 channel to shut up 2000 </para> 2001 </listitem> 2002 </varlistentry> 2003 </variablelist> 2004</refsect1> 2005<refsect1> 2006<title>Description</title> 2007<para> 2008 Transmit interrupt vectors for a Z8530 that is in 'parked' mode. 2009 For machines with PCI Z85x30 cards, or level triggered interrupts 2010 (eg the MacII) we must clear the interrupt cause or die. 2011</para> 2012</refsect1> 2013</refentry> 2014 2015<refentry id="API-z8530-status-clear"> 2016<refentryinfo> 2017 <title>LINUX</title> 2018 <productname>Kernel Hackers Manual</productname> 2019 <date>July 2017</date> 2020</refentryinfo> 2021<refmeta> 2022 <refentrytitle><phrase>z8530_status_clear</phrase></refentrytitle> 2023 <manvolnum>9</manvolnum> 2024 <refmiscinfo class="version">4.1.27</refmiscinfo> 2025</refmeta> 2026<refnamediv> 2027 <refname>z8530_status_clear</refname> 2028 <refpurpose> 2029 Handle status events from a stopped chip 2030 </refpurpose> 2031</refnamediv> 2032<refsynopsisdiv> 2033 <title>Synopsis</title> 2034 <funcsynopsis><funcprototype> 2035 <funcdef>void <function>z8530_status_clear </function></funcdef> 2036 <paramdef>struct z8530_channel * <parameter>chan</parameter></paramdef> 2037 </funcprototype></funcsynopsis> 2038</refsynopsisdiv> 2039<refsect1> 2040 <title>Arguments</title> 2041 <variablelist> 2042 <varlistentry> 2043 <term><parameter>chan</parameter></term> 2044 <listitem> 2045 <para> 2046 Z8530 channel to shut up 2047 </para> 2048 </listitem> 2049 </varlistentry> 2050 </variablelist> 2051</refsect1> 2052<refsect1> 2053<title>Description</title> 2054<para> 2055 Status interrupt vectors for a Z8530 that is in 'parked' mode. 2056 For machines with PCI Z85x30 cards, or level triggered interrupts 2057 (eg the MacII) we must clear the interrupt cause or die. 2058</para> 2059</refsect1> 2060</refentry> 2061 2062<refentry id="API-z8530-tx-begin"> 2063<refentryinfo> 2064 <title>LINUX</title> 2065 <productname>Kernel Hackers Manual</productname> 2066 <date>July 2017</date> 2067</refentryinfo> 2068<refmeta> 2069 <refentrytitle><phrase>z8530_tx_begin</phrase></refentrytitle> 2070 <manvolnum>9</manvolnum> 2071 <refmiscinfo class="version">4.1.27</refmiscinfo> 2072</refmeta> 2073<refnamediv> 2074 <refname>z8530_tx_begin</refname> 2075 <refpurpose> 2076 Begin packet transmission 2077 </refpurpose> 2078</refnamediv> 2079<refsynopsisdiv> 2080 <title>Synopsis</title> 2081 <funcsynopsis><funcprototype> 2082 <funcdef>void <function>z8530_tx_begin </function></funcdef> 2083 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 2084 </funcprototype></funcsynopsis> 2085</refsynopsisdiv> 2086<refsect1> 2087 <title>Arguments</title> 2088 <variablelist> 2089 <varlistentry> 2090 <term><parameter>c</parameter></term> 2091 <listitem> 2092 <para> 2093 The Z8530 channel to kick 2094 </para> 2095 </listitem> 2096 </varlistentry> 2097 </variablelist> 2098</refsect1> 2099<refsect1> 2100<title>Description</title> 2101<para> 2102 This is the speed sensitive side of transmission. If we are called 2103 and no buffer is being transmitted we commence the next buffer. If 2104 nothing is queued we idle the sync. 2105</para> 2106</refsect1> 2107<refsect1> 2108<title>Note</title> 2109<para> 2110 We are handling this code path in the interrupt path, keep it 2111 fast or bad things will happen. 2112 </para><para> 2113 2114 Called with the lock held. 2115</para> 2116</refsect1> 2117</refentry> 2118 2119<refentry id="API-z8530-tx-done"> 2120<refentryinfo> 2121 <title>LINUX</title> 2122 <productname>Kernel Hackers Manual</productname> 2123 <date>July 2017</date> 2124</refentryinfo> 2125<refmeta> 2126 <refentrytitle><phrase>z8530_tx_done</phrase></refentrytitle> 2127 <manvolnum>9</manvolnum> 2128 <refmiscinfo class="version">4.1.27</refmiscinfo> 2129</refmeta> 2130<refnamediv> 2131 <refname>z8530_tx_done</refname> 2132 <refpurpose> 2133 TX complete callback 2134 </refpurpose> 2135</refnamediv> 2136<refsynopsisdiv> 2137 <title>Synopsis</title> 2138 <funcsynopsis><funcprototype> 2139 <funcdef>void <function>z8530_tx_done </function></funcdef> 2140 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 2141 </funcprototype></funcsynopsis> 2142</refsynopsisdiv> 2143<refsect1> 2144 <title>Arguments</title> 2145 <variablelist> 2146 <varlistentry> 2147 <term><parameter>c</parameter></term> 2148 <listitem> 2149 <para> 2150 The channel that completed a transmit. 2151 </para> 2152 </listitem> 2153 </varlistentry> 2154 </variablelist> 2155</refsect1> 2156<refsect1> 2157<title>Description</title> 2158<para> 2159 This is called when we complete a packet send. We wake the queue, 2160 start the next packet going and then free the buffer of the existing 2161 packet. This code is fairly timing sensitive. 2162 </para><para> 2163 2164 Called with the register lock held. 2165</para> 2166</refsect1> 2167</refentry> 2168 2169<refentry id="API-z8530-rx-done"> 2170<refentryinfo> 2171 <title>LINUX</title> 2172 <productname>Kernel Hackers Manual</productname> 2173 <date>July 2017</date> 2174</refentryinfo> 2175<refmeta> 2176 <refentrytitle><phrase>z8530_rx_done</phrase></refentrytitle> 2177 <manvolnum>9</manvolnum> 2178 <refmiscinfo class="version">4.1.27</refmiscinfo> 2179</refmeta> 2180<refnamediv> 2181 <refname>z8530_rx_done</refname> 2182 <refpurpose> 2183 Receive completion callback 2184 </refpurpose> 2185</refnamediv> 2186<refsynopsisdiv> 2187 <title>Synopsis</title> 2188 <funcsynopsis><funcprototype> 2189 <funcdef>void <function>z8530_rx_done </function></funcdef> 2190 <paramdef>struct z8530_channel * <parameter>c</parameter></paramdef> 2191 </funcprototype></funcsynopsis> 2192</refsynopsisdiv> 2193<refsect1> 2194 <title>Arguments</title> 2195 <variablelist> 2196 <varlistentry> 2197 <term><parameter>c</parameter></term> 2198 <listitem> 2199 <para> 2200 The channel that completed a receive 2201 </para> 2202 </listitem> 2203 </varlistentry> 2204 </variablelist> 2205</refsect1> 2206<refsect1> 2207<title>Description</title> 2208<para> 2209 A new packet is complete. Our goal here is to get back into receive 2210 mode as fast as possible. On the Z85230 we could change to using 2211 ESCC mode, but on the older chips we have no choice. We flip to the 2212 new buffer immediately in DMA mode so that the DMA of the next 2213 frame can occur while we are copying the previous buffer to an sk_buff 2214 </para><para> 2215 2216 Called with the lock held 2217</para> 2218</refsect1> 2219</refentry> 2220 2221<refentry id="API-spans-boundary"> 2222<refentryinfo> 2223 <title>LINUX</title> 2224 <productname>Kernel Hackers Manual</productname> 2225 <date>July 2017</date> 2226</refentryinfo> 2227<refmeta> 2228 <refentrytitle><phrase>spans_boundary</phrase></refentrytitle> 2229 <manvolnum>9</manvolnum> 2230 <refmiscinfo class="version">4.1.27</refmiscinfo> 2231</refmeta> 2232<refnamediv> 2233 <refname>spans_boundary</refname> 2234 <refpurpose> 2235 Check a packet can be ISA DMA'd 2236 </refpurpose> 2237</refnamediv> 2238<refsynopsisdiv> 2239 <title>Synopsis</title> 2240 <funcsynopsis><funcprototype> 2241 <funcdef>int <function>spans_boundary </function></funcdef> 2242 <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef> 2243 </funcprototype></funcsynopsis> 2244</refsynopsisdiv> 2245<refsect1> 2246 <title>Arguments</title> 2247 <variablelist> 2248 <varlistentry> 2249 <term><parameter>skb</parameter></term> 2250 <listitem> 2251 <para> 2252 The buffer to check 2253 </para> 2254 </listitem> 2255 </varlistentry> 2256 </variablelist> 2257</refsect1> 2258<refsect1> 2259<title>Description</title> 2260<para> 2261 Returns true if the buffer cross a DMA boundary on a PC. The poor 2262 thing can only DMA within a 64K block not across the edges of it. 2263</para> 2264</refsect1> 2265</refentry> 2266 2267 </chapter> 2268 2269</book> 2270