- outputf("3C90X: Status (%hhX)", status);
- /** check error codes **/
- if (status & 0x02)
- {
- outputf("3C90X: Tx Reclaim Error (%hhX)", status);
- a3c90x_reset();
- }
- else if (status & 0x04)
- {
- outputf("3C90X: Tx Status Overflow (%hhX)", status);
- for (i=0; i<32; i++)
- _outb(0x00, INF_3C90X.IOAddr + regTxStatus_b);
- /** must re-enable after max collisions before re-issuing tx **/
- a3c90x_internal_IssueCommand(INF_3C90X.IOAddr, cmdTxEnable, 0);
- }
- else if (status & 0x08)
- {
- outputf("3C90X: Tx Max Collisions (%hhX)", status);
- /** must re-enable after max collisions before re-issuing tx **/
- a3c90x_internal_IssueCommand(INF_3C90X.IOAddr, cmdTxEnable, 0);
- }
- else if (status & 0x10)
- {
- outputf("3C90X: Tx Underrun (%hhX)", status);
- a3c90x_reset();
- }
- else if (status & 0x20)
- {
- outputf("3C90X: Tx Jabber (%hhX)", status);
- a3c90x_reset();
- }
- else if ((status & 0x80) != 0x80)
- {
- outputf("3C90X: Internal Error - Incomplete Transmission (%hhX)",
- status);
- a3c90x_reset();
- }
+ if (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w) & INT_TXCOMPLETE))
+ {
+ outputf("3c90x: tx timeout? stat %02x", inb(INF_3C90X.IOAddr + regTxStatus_b));
+ _issue_command(INF_3C90X.IOAddr, cmdTxReset, 0);
+ if (! INF_3C90X.isBrev)
+ _outb(0x01, INF_3C90X.IOAddr + regTxFreeThresh_b);
+ _issue_command(INF_3C90X.IOAddr, cmdTxEnable, 0);
+ _issue_command(INF_3C90X.IOAddr, cmdSetInterruptEnable, 0);
+ _issue_command(INF_3C90X.IOAddr, cmdSetIndicationEnable, 0x0014);
+ _issue_command(INF_3C90X.IOAddr, cmdAcknowledgeInterrupt, 0x661);
+ continue;
+ }
+ status = inb(INF_3C90X.IOAddr + regTxStatus_b);
+ outb(INF_3C90X.IOAddr + regTxStatus_b, 0x00);
+
+ _issue_command(INF_3C90X.IOAddr, cmdAcknowledgeInterrupt, INT_TXCOMPLETE);
+
+ /** successful completion (sans "interrupt Requested" bit) **/
+ if ((status & 0xbf) == 0x80)
+ return;
+
+ outputf("3c90x: Status (%hhX)", status);
+ /** check error codes **/
+ if (status & 0x02)
+ {
+ outputf("3c90x: Tx Reclaim Error (%hhX)", status);
+ a3c90x_reset();
+ } else if (status & 0x04) {
+ outputf("3c90x: Tx Status Overflow (%hhX)", status);
+ for (i=0; i<32; i++)
+ _outb(0x00, INF_3C90X.IOAddr + regTxStatus_b);
+ /** must re-enable after max collisions before re-issuing tx **/
+ _issue_command(INF_3C90X.IOAddr, cmdTxEnable, 0);
+ } else if (status & 0x08) {
+ outputf("3c90x: Tx Max Collisions (%hhX)", status);
+ /** must re-enable after max collisions before re-issuing tx **/
+ _issue_command(INF_3C90X.IOAddr, cmdTxEnable, 0);
+ } else if (status & 0x10) {
+ outputf("3c90x: Tx Underrun (%hhX)", status);
+ a3c90x_reset();
+ } else if (status & 0x20) {
+ outputf("3c90x: Tx Jabber (%hhX)", status);
+ a3c90x_reset();
+ } else if ((status & 0x80) != 0x80) {
+ outputf("3c90x: Internal Error - Incomplete Transmission (%hhX)", status);
+ a3c90x_reset();
+ }