2 * Copyright (c) 2011, 2012, Qualcomm Atheros Communications Inc.
3 * Copyright (c) 2014, I2SE GmbH
5 * Permission to use, copy, modify, and/or distribute this software
6 * for any purpose with or without fee is hereby granted, provided
7 * that the above copyright notice and this permission notice appear
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
13 * THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
14 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
16 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
17 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 /* Qualcomm Atheros SPI register definition.
22 * This module is designed to define the Qualcomm Atheros SPI register
29 #include <linux/netdevice.h>
30 #include <linux/sched.h>
31 #include <linux/skbuff.h>
32 #include <linux/spi/spi.h>
33 #include <linux/types.h>
35 #include "qca_framing.h"
37 #define QCASPI_DRV_VERSION "0.2.7-i"
38 #define QCASPI_DRV_NAME "qcaspi"
40 #define QCASPI_GOOD_SIGNATURE 0xAA55
42 #define TX_RING_MAX_LEN 10
43 #define TX_RING_MIN_LEN 2
45 /* sync related constants */
46 #define QCASPI_SYNC_UNKNOWN 0
47 #define QCASPI_SYNC_RESET 1
48 #define QCASPI_SYNC_READY 2
50 #define QCASPI_RESET_TIMEOUT 10
53 #define QCASPI_EVENT_UPDATE 0
54 #define QCASPI_EVENT_CPUON 1
57 struct sk_buff
*skb
[TX_RING_MAX_LEN
];
79 struct net_device
*net_dev
;
80 struct spi_device
*spi_dev
;
81 struct task_struct
*spi_thread
;
84 struct qcaspi_stats stats
;
86 struct spi_message spi_msg1
;
87 struct spi_message spi_msg2
;
88 struct spi_transfer spi_xfer1
;
89 struct spi_transfer spi_xfer2
[2];
95 struct qcafrm_handle frm_handle
;
96 struct sk_buff
*rx_skb
;
98 unsigned int intr_req
;
99 unsigned int intr_svc
;
101 #ifdef CONFIG_DEBUG_FS
102 struct dentry
*device_root
;
105 /* user configurable options */
111 int qcaspi_netdev_open(struct net_device
*dev
);
112 int qcaspi_netdev_close(struct net_device
*dev
);
114 #endif /* _QCA_SPI_H */