drivers/net/wireless/intel/ipw2x00/libipw_crypto_tkip.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/ipw2x00/libipw_crypto_tkip.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/ipw2x00/libipw_crypto_tkip.c- Extension
.c- Size
- 16690 bytes
- Lines
- 619
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/fips.hlinux/module.hlinux/init.hlinux/slab.hlinux/random.hlinux/scatterlist.hlinux/skbuff.hlinux/netdevice.hlinux/mm.hlinux/if_ether.hlinux/if_arp.hasm/string.hlinux/wireless.hlinux/ieee80211.hnet/iw_handler.hcrypto/arc4.hlinux/crc32.hlibipw.h
Detected Declarations
struct libipw_tkip_datafunction libipw_tkip_set_flagsfunction libipw_tkip_get_flagsfunction libipw_tkip_deinitfunction RotR1function Lo8function Hi8function Lo16function Hi16function Mk16function Mk16_lefunction _S_function tkip_mixing_phase1function tkip_mixing_phase2function libipw_tkip_hdrfunction libipw_tkip_encryptfunction timer_afterfunction libipw_tkip_decryptfunction libipw_michael_mic_addfunction libipw_michael_mic_failurefunction libipw_michael_mic_verifyfunction libipw_tkip_set_keyfunction libipw_tkip_get_keyfunction libipw_tkip_print_statsfunction libipw_crypto_tkip_initfunction libipw_crypto_tkip_exit
Annotated Snippet
struct libipw_tkip_data {
#define TKIP_KEY_LEN 32
u8 key[TKIP_KEY_LEN];
int key_set;
u32 tx_iv32;
u16 tx_iv16;
u16 tx_ttak[5];
int tx_phase1_done;
u32 rx_iv32;
u16 rx_iv16;
u16 rx_ttak[5];
int rx_phase1_done;
u32 rx_iv32_new;
u16 rx_iv16_new;
u32 dot11RSNAStatsTKIPReplays;
u32 dot11RSNAStatsTKIPICVErrors;
u32 dot11RSNAStatsTKIPLocalMICFailures;
int key_idx;
struct arc4_ctx rx_ctx_arc4;
struct arc4_ctx tx_ctx_arc4;
unsigned long flags;
};
static unsigned long libipw_tkip_set_flags(unsigned long flags, void *priv)
{
struct libipw_tkip_data *_priv = priv;
unsigned long old_flags = _priv->flags;
_priv->flags = flags;
return old_flags;
}
static unsigned long libipw_tkip_get_flags(void *priv)
{
struct libipw_tkip_data *_priv = priv;
return _priv->flags;
}
static void *libipw_tkip_init(int key_idx)
{
struct libipw_tkip_data *priv;
if (fips_enabled)
return NULL;
priv = kzalloc_obj(*priv, GFP_ATOMIC);
if (priv == NULL)
return priv;
priv->key_idx = key_idx;
return priv;
}
static void libipw_tkip_deinit(void *priv)
{
kfree_sensitive(priv);
}
static inline u16 RotR1(u16 val)
{
return (val >> 1) | (val << 15);
}
static inline u8 Lo8(u16 val)
{
return val & 0xff;
}
static inline u8 Hi8(u16 val)
{
return val >> 8;
}
static inline u16 Lo16(u32 val)
{
return val & 0xffff;
}
static inline u16 Hi16(u32 val)
{
return val >> 16;
}
static inline u16 Mk16(u8 hi, u8 lo)
{
Annotation
- Immediate include surface: `linux/err.h`, `linux/fips.h`, `linux/module.h`, `linux/init.h`, `linux/slab.h`, `linux/random.h`, `linux/scatterlist.h`, `linux/skbuff.h`.
- Detected declarations: `struct libipw_tkip_data`, `function libipw_tkip_set_flags`, `function libipw_tkip_get_flags`, `function libipw_tkip_deinit`, `function RotR1`, `function Lo8`, `function Hi8`, `function Lo16`, `function Hi16`, `function Mk16`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.