Lines Matching +full:retain +full:- +full:state +full:- +full:shutdown
3 * Declarations for bus-generic internal APIs
6 * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
12 * * Redistributions of source code must retain the above copyright
35 * Intel Corporation <linux-wimax@intel.com>
36 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
38 * - Initial implementation
45 * - bus specific driver
46 * - bus generic driver (this part)
49 * device is connected to (USB, PCI, tam-tam...non-authoritative
50 * nor binding list) which is basically the device-model management
54 * For details on each bus-specific driver, see it's include file,
55 * i2400m-BUSNAME.h
57 * The bus-generic functionality break up is:
59 * - Firmware upload: fw.c - takes care of uploading firmware to the
60 * device. bus-specific driver just needs to provides a way to
61 * execute boot-mode commands and to reset the device.
63 * - RX handling: rx.c - receives data from the bus-specific code and
65 * the driver state. bus-specific driver only has to receive
68 * - TX handling: tx.c - manages the TX FIFO queue and provides means
69 * for the bus-specific TX code to pull data from the FIFO
70 * queue. bus-specific code just pulls frames from this module
73 * - netdev glue: netdev.c - interface with Linux networking
75 * device is up and running or shutdown (through ifconfig up /
76 * down). Bus-generic only.
78 * - control ops: control.c - implements various commands for
79 * controlling the device. bus-generic only.
81 * - device model glue: driver.c - implements helpers for the
82 * device-model glue done by the bus-specific layer
87 * Code is also broken up in linux-glue / device-glue.
92 * Device-glue are functions that deal mostly with the way the device
95 * device-glue code is licensed BSD so other open source OSes can take
103 * - HDI (host-device interface) definitions common to all busses
106 * - internal API for the bus-generic code
107 * - external API for the bus-specific drivers
112 * When the bus-specific driver probes, it allocates a network device
117 * well as i2400m->wimax_dev.net_dev and call i2400m_setup(). The
122 * The high-level call flow is:
126 * i2400m->bus_setup()
130 * i2400m->bus_dev_start()
139 * i2400m->bus_dev_stop()
141 * i2400m->bus_release()
145 * While the device is up, it might reset. The bus-specific driver has
186 * struct i2400m_poke_table - Hardware poke table for the Intel 2400m
189 * to put the device in a consistent state at boot time.
208 * i2400m_reset_type - methods to reset a device
211 * are kept valid but state is back to power on, with firmware
212 * re-uploaded.
229 * struct i2400m - descriptor for an Intel 2400m
251 * @bus_setup: [optional fill] Function called by the bus-generic code
252 * [i2400m_setup()] to setup the basic bus-specific communications
256 * care of by the bus-generic code.
258 * @bus_release: [optional fill] Function called by the bus-generic
259 * code [i2400m_release()] to shutdown the basic bus-specific
267 * @bus_dev_start: [optional fill] Function called by the bus-generic
272 * care of by the bus-generic code.
274 * @bus_dev_stop: [optional fill] Function called by the bus-generic
282 * @bus_tx_kick: [fill] Function called by the bus-generic code to let
283 * the bus-specific code know that there is data available in the
288 * @bus_reset: [fill] Function called by the bus-generic code to reset
293 * bus-specific reset (eg: USB reset) to get the device to a
294 * working state (even if it implies device disconecction).
303 * IMPORTANT: don't call reset on RT_BUS with i2400m->init_mutex
309 * bus-specific driver. Note this value is used in two places,
317 * @bus_bm_cmd_send: [fill] Function called to send a boot-mode
323 * boot-mode notification (that can be a response to a previously
332 * @bus_fw_names: [fill] a NULL-terminated array with the names of the
336 * should be i2400m-fw-X-VERSION.sbcf, where X is the bus name.
338 * used. The fw loader will set i2400m->fw_name to point to the
343 * be re-read later on.
347 * device to the correct state for the type of boot/firmware being
362 * Write to it only inside a i2400m->init_mutex protected area
364 * inside i2400m->init_mutex). Read access can be loose like that
370 * using the WiMAX state for certain hot paths).
372 * Write to it only inside a i2400m->init_mutex protected area
374 * inside i2400m->init_mutex). Read access can be loose like that
381 * @state: device's state (as reported by it)
383 * @state_wq: waitqueue that is woken up whenever the state changes
401 * bus-specific code.
467 * only allow one at a time, per host-device interface design).
481 * sequential, but in case the device sends an out-of-phase or
507 * (wimax_dev->debugfs_dentry) so they can be removed when the
524 * the spinlock i2400m->rx_lock.
549 * the device state *we expect* rather than the actual state as denoted
552 * (i2400m->alive remains 1) until the driver is removed. Therefore
576 enum i2400m_system_state state; member
577 wait_queue_head_t state_wq; /* Woken up when on state updates */
599 spinlock_t tx_lock; /* protect TX state */
609 /* protect RX state and rx_roq_refcount */
661 * Bus-generic internal APIs
662 * -------------------------
682 * i2400m_bm_cmd_flags - flags to i2400m_bm_cmd()
684 * @I2400M_BM_CMD_RAW: send the command block as-is, without doing any
692 * i2400m_bri - Boot-ROM indicators
704 * if you ask me -- the device requires the bootrom to be
726 /* Make/grok boot-rom header commands */
744 hdr->command = cpu_to_le32( in i2400m_brh_set_opcode()
745 (le32_to_cpu(hdr->command) & ~I2400M_BRH_OPCODE_MASK) in i2400m_brh_set_opcode()
752 return le32_to_cpu(hdr->command) & I2400M_BRH_OPCODE_MASK; in i2400m_brh_get_opcode()
758 return (le32_to_cpu(hdr->command) & I2400M_BRH_RESPONSE_MASK) in i2400m_brh_get_response()
765 return le32_to_cpu(hdr->command) & I2400M_BRH_USE_CHECKSUM; in i2400m_brh_get_use_checksum()
772 return le32_to_cpu(hdr->command) & I2400M_BRH_RESPONSE_REQUIRED; in i2400m_brh_get_response_required()
778 return le32_to_cpu(hdr->command) & I2400M_BRH_DIRECT_ACCESS; in i2400m_brh_get_direct_access()
784 return (le32_to_cpu(hdr->command) & I2400M_BRH_SIGNATURE_MASK) in i2400m_brh_get_signature()
822 /* Initialize/shutdown the device */
834 return I2400M_PLD_SIZE_MASK & le32_to_cpu(pld->val); in i2400m_pld_size()
840 return (I2400M_PLD_TYPE_MASK & le32_to_cpu(pld->val)) in i2400m_pld_type()
848 pld->val = cpu_to_le32( in i2400m_pld_set()
855 * API for the bus-specific drivers
856 * --------------------------------
862 dev_hold(i2400m->wimax_dev.net_dev); in i2400m_get()
869 dev_put(i2400m->wimax_dev.net_dev); in i2400m_put()
879 * the bus-specific drivers.
896 return i2400m->wimax_dev.net_dev->dev.parent; in i2400m_dev()
916 return &iface->cur_altsetting->endpoint[ep].desc; in usb_get_epd()
939 return i2400m->fw_version <= 0x00090001; in i2400m_le_v1_3()
946 return i2400m->fw_version >= 0x00090002; in i2400m_ge_v1_4()
951 * Do a millisecond-sleep for allowing wireshark to dump all the data