fec: cleanup tx variable names

Rename skb_dirty to tx_remove
Rename skb_cur to tx_insert
Kill redundant dirty_tx (tx_bd_base + tx_remove)
Kill redundant cur_tx (tx_bd_base + tx_insert)

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: Use cur_rx as an index

The variable type is changed. Old cur_rx
is equivalent to rx_bd_base + cur_rx

The helps later patches where the skb index is needed.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: transfer buffer ownership as last access to buffer

After ownership is transferred, you aren't supposed to
access the buffer until the fec gives it back.

Also, don't rely on the wrap flag. We know when the
wrap flag should be set or clear.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: remove TX_RING_MOD_MASK, don't rely on wrap in cbd_sc

TX_RING_SIZE no longer needs to be a power of 2.
Don't rely on current wrap flag in descriptor when giving
a descriptor to the controller.

add mb() so that we can be sure the ownership is transferred
as the last access to the descriptor.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: remove unneeded opened flag

Whether the skb has been allocated for the
receive buffer is a more direct test.
fec: remove __va conversion

skb->data is the virtual address, so use that.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: FEC_ALIGNMENT + 1  becomes FEC_TX_ALIGNMENT

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: FEC_TX_ALIGNMENT is 8 for MX6

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: remove useless macros, save space

Also save a little space by lowering rx/tx frame size
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: save some buffer space

Allocate the tx bounce buffers all at once
since they aren't that much space.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: add debugfs file

Show number of overruns,
Other status flags of last overrun,
most rx packets in 1 interrupt,
most tx packets in 1 interrupt,
number of rx packets received,
number of tx packets queued by offset (8 numbers for mx6)

since the last time the file was read.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: delete inaccessable code

BD_ENET_TX_READY most be clear to
make it to the point that prints an error
if not clear, so delete the check.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: on tx, only map/umap the length of the packet

It is wasteful to map the maximum packet size when
only a small packet is to be sent.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: include ENDIAN_SWAP for mx6

Let's keep the ENDIAN_SWAP bit set even when stopped
for mx6q.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: rename variables in fec_restart

Have variables the same name as the register
to be stuffed into, makes the code easier to read.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: write FEC_R_CNTRL only once in fec_restart

This saves code.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: add WARN_ONCE if a bus error happens

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: clear cbd_prot and cbd_bdu in fec_enet_alloc_buffers

Should not rely on the field already being clear.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: print more error info on tx timeout

Print more useful info in function fec_timeout

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
fec: enable tx/rx of pause frames for mx6q

I don't know what ticket TKT116501 is but
I don't see a problem with pause frame
enabled on rev 1.0 silicon.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>