drivers/media/common/siano/smsendian.c
Source file repositories/reference/linux-study-clean/drivers/media/common/siano/smsendian.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/common/siano/smsendian.c- Extension
.c- Size
- 2159 bytes
- Lines
- 95
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hasm/byteorder.hsmsendian.hsmscoreapi.h
Detected Declarations
function smsendian_handle_tx_messagefunction smsendian_handle_rx_messagefunction smsendian_handle_message_headerexport smsendian_handle_tx_messageexport smsendian_handle_rx_messageexport smsendian_handle_message_header
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/****************************************************************
Siano Mobile Silicon, Inc.
MDTV receiver kernel modules.
Copyright (C) 2006-2009, Uri Shkolnik
****************************************************************/
#include <linux/export.h>
#include <asm/byteorder.h>
#include "smsendian.h"
#include "smscoreapi.h"
void smsendian_handle_tx_message(void *buffer)
{
#ifdef __BIG_ENDIAN
struct sms_msg_data *msg = buffer;
int i;
int msg_words;
u32 *msg_data = &msg->msg_data;
switch (msg->x_msg_header.msg_type) {
case MSG_SMS_DATA_DOWNLOAD_REQ:
{
msg->msg_data = le32_to_cpu((__force __le32)(msg->msg_data));
break;
}
default:
msg_words = (msg->x_msg_header.msg_length -
sizeof(struct sms_msg_hdr))/4;
for (i = 0; i < msg_words; i++)
msg_data[i] = le32_to_cpu((__force __le32)msg_data[i]);
break;
}
#endif /* __BIG_ENDIAN */
}
EXPORT_SYMBOL_GPL(smsendian_handle_tx_message);
void smsendian_handle_rx_message(void *buffer)
{
#ifdef __BIG_ENDIAN
struct sms_msg_data *msg = (struct sms_msg_data *)buffer;
int i;
int msg_words;
switch (msg->x_msg_header.msg_type) {
case MSG_SMS_GET_VERSION_EX_RES:
{
struct sms_version_res *ver =
(struct sms_version_res *) msg;
ver->chip_model = le16_to_cpu((__force __le16)ver->chip_model);
break;
}
case MSG_SMS_DVBT_BDA_DATA:
case MSG_SMS_DAB_CHANNEL:
case MSG_SMS_DATA_MSG:
{
break;
}
default:
{
u32 *msg_data = &msg->msg_data;
msg_words = (msg->x_msg_header.msg_length -
sizeof(struct sms_msg_hdr))/4;
for (i = 0; i < msg_words; i++)
msg_data[i] = le32_to_cpu((__force __le32)msg_data[i]);
break;
}
}
#endif /* __BIG_ENDIAN */
}
EXPORT_SYMBOL_GPL(smsendian_handle_rx_message);
void smsendian_handle_message_header(void *msg)
{
#ifdef __BIG_ENDIAN
struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)msg;
phdr->msg_type = le16_to_cpu((__force __le16)phdr->msg_type);
phdr->msg_length = le16_to_cpu((__force __le16)phdr->msg_length);
Annotation
- Immediate include surface: `linux/export.h`, `asm/byteorder.h`, `smsendian.h`, `smscoreapi.h`.
- Detected declarations: `function smsendian_handle_tx_message`, `function smsendian_handle_rx_message`, `function smsendian_handle_message_header`, `export smsendian_handle_tx_message`, `export smsendian_handle_rx_message`, `export smsendian_handle_message_header`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: integration 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.