aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wimax/i2400m/i2400m.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wimax/i2400m/i2400m.h')
-rw-r--r--drivers/net/wimax/i2400m/i2400m.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h
index 3ae2df38b59a..1fe5da4cf0a0 100644
--- a/drivers/net/wimax/i2400m/i2400m.h
+++ b/drivers/net/wimax/i2400m/i2400m.h
@@ -150,11 +150,33 @@
150enum { 150enum {
151 /* Firmware uploading */ 151 /* Firmware uploading */
152 I2400M_BOOT_RETRIES = 3, 152 I2400M_BOOT_RETRIES = 3,
153 I3200_BOOT_RETRIES = 3,
153 /* Size of the Boot Mode Command buffer */ 154 /* Size of the Boot Mode Command buffer */
154 I2400M_BM_CMD_BUF_SIZE = 16 * 1024, 155 I2400M_BM_CMD_BUF_SIZE = 16 * 1024,
155 I2400M_BM_ACK_BUF_SIZE = 256, 156 I2400M_BM_ACK_BUF_SIZE = 256,
156}; 157};
157 158
159/**
160 * struct i2400m_poke_table - Hardware poke table for the Intel 2400m
161 *
162 * This structure will be used to create a device specific poke table
163 * to put the device in a consistant state at boot time.
164 *
165 * @address: The device address to poke
166 *
167 * @data: The data value to poke to the device address
168 *
169 */
170struct i2400m_poke_table{
171 __le32 address;
172 __le32 data;
173};
174
175#define I2400M_FW_POKE(a, d) { \
176 .address = cpu_to_le32(a), \
177 .data = cpu_to_le32(d) \
178}
179
158 180
159/** 181/**
160 * i2400m_reset_type - methods to reset a device 182 * i2400m_reset_type - methods to reset a device
@@ -224,6 +246,17 @@ struct i2400m_roq;
224 * process, so it cannot rely on common infrastructure being laid 246 * process, so it cannot rely on common infrastructure being laid
225 * out. 247 * out.
226 * 248 *
249 * @bus_bm_retries: [fill] How many times shall a firmware upload /
250 * device initialization be retried? Different models of the same
251 * device might need different values, hence it is set by the
252 * bus-specific driver. Note this value is used in two places,
253 * i2400m_fw_dnload() and __i2400m_dev_start(); they won't become
254 * multiplicative (__i2400m_dev_start() calling N times
255 * i2400m_fw_dnload() and this trying N times to download the
256 * firmware), as if __i2400m_dev_start() only retries if the
257 * firmware crashed while initializing the device (not in a
258 * general case).
259 *
227 * @bus_bm_cmd_send: [fill] Function called to send a boot-mode 260 * @bus_bm_cmd_send: [fill] Function called to send a boot-mode
228 * command. Flags are defined in 'enum i2400m_bm_cmd_flags'. This 261 * command. Flags are defined in 'enum i2400m_bm_cmd_flags'. This
229 * is synchronous and has to return 0 if ok or < 0 errno code in 262 * is synchronous and has to return 0 if ok or < 0 errno code in
@@ -252,6 +285,12 @@ struct i2400m_roq;
252 * address provided in boot mode is kind of broken and needs to 285 * address provided in boot mode is kind of broken and needs to
253 * be re-read later on. 286 * be re-read later on.
254 * 287 *
288 * @bus_bm_pokes_table: [fill/optional] A table of device addresses
289 * and values that will be poked at device init time to move the
290 * device to the correct state for the type of boot/firmware being
291 * used. This table MUST be terminated with (0x000000,
292 * 0x00000000) or bad things will happen.
293 *
255 * 294 *
256 * @wimax_dev: WiMAX generic device for linkage into the kernel WiMAX 295 * @wimax_dev: WiMAX generic device for linkage into the kernel WiMAX
257 * stack. Due to the way a net_device is allocated, we need to 296 * stack. Due to the way a net_device is allocated, we need to
@@ -323,6 +362,10 @@ struct i2400m_roq;
323 * delivered. Then the driver can release them to the host. See 362 * delivered. Then the driver can release them to the host. See
324 * drivers/net/i2400m/rx.c for details. 363 * drivers/net/i2400m/rx.c for details.
325 * 364 *
365 * @src_mac_addr: MAC address used to make ethernet packets be coming
366 * from. This is generated at i2400m_setup() time and used during
367 * the life cycle of the instance. See i2400m_fake_eth_header().
368 *
326 * @init_mutex: Mutex used for serializing the device bringup 369 * @init_mutex: Mutex used for serializing the device bringup
327 * sequence; this way if the device reboots in the middle, we 370 * sequence; this way if the device reboots in the middle, we
328 * don't try to do a bringup again while we are tearing down the 371 * don't try to do a bringup again while we are tearing down the
@@ -395,6 +438,8 @@ struct i2400m {
395 438
396 size_t bus_tx_block_size; 439 size_t bus_tx_block_size;
397 size_t bus_pl_size_max; 440 size_t bus_pl_size_max;
441 unsigned bus_bm_retries;
442
398 int (*bus_dev_start)(struct i2400m *); 443 int (*bus_dev_start)(struct i2400m *);
399 void (*bus_dev_stop)(struct i2400m *); 444 void (*bus_dev_stop)(struct i2400m *);
400 void (*bus_tx_kick)(struct i2400m *); 445 void (*bus_tx_kick)(struct i2400m *);
@@ -406,6 +451,7 @@ struct i2400m {
406 struct i2400m_bootrom_header *, size_t); 451 struct i2400m_bootrom_header *, size_t);
407 const char **bus_fw_names; 452 const char **bus_fw_names;
408 unsigned bus_bm_mac_addr_impaired:1; 453 unsigned bus_bm_mac_addr_impaired:1;
454 const struct i2400m_poke_table *bus_bm_pokes_table;
409 455
410 spinlock_t tx_lock; /* protect TX state */ 456 spinlock_t tx_lock; /* protect TX state */
411 void *tx_buf; 457 void *tx_buf;
@@ -421,6 +467,7 @@ struct i2400m {
421 unsigned rx_pl_num, rx_pl_max, rx_pl_min, 467 unsigned rx_pl_num, rx_pl_max, rx_pl_min,
422 rx_num, rx_size_acc, rx_size_min, rx_size_max; 468 rx_num, rx_size_acc, rx_size_min, rx_size_max;
423 struct i2400m_roq *rx_roq; /* not under rx_lock! */ 469 struct i2400m_roq *rx_roq; /* not under rx_lock! */
470 u8 src_mac_addr[ETH_HLEN];
424 471
425 struct mutex msg_mutex; /* serialize command execution */ 472 struct mutex msg_mutex; /* serialize command execution */
426 struct completion msg_completion; 473 struct completion msg_completion;
@@ -704,6 +751,7 @@ static const __le32 i2400m_SBOOT_BARKER[4] = {
704 cpu_to_le32(I2400M_SBOOT_BARKER) 751 cpu_to_le32(I2400M_SBOOT_BARKER)
705}; 752};
706 753
754extern int i2400m_power_save_disabled;
707 755
708/* 756/*
709 * Utility functions 757 * Utility functions