本文整理汇总了C++中d_fnstart函数的典型用法代码示例。如果您正苦于以下问题:C++ d_fnstart函数的具体用法?C++ d_fnstart怎么用?C++ d_fnstart使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了d_fnstart函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: i2400mu_bus_dev_stop
static
void i2400mu_bus_dev_stop(struct i2400m *i2400m)
{
struct i2400mu *i2400mu = container_of(i2400m, struct i2400mu, i2400m);
struct device *dev = &i2400mu->usb_iface->dev;
d_fnstart(3, dev, "(i2400m %p)\n", i2400m);
i2400mu_notification_release(i2400mu);
i2400mu_rx_release(i2400mu);
i2400mu_tx_release(i2400mu);
d_fnend(3, dev, "(i2400m %p) = void\n", i2400m);
}
示例2: i2400m_bm_cmd
/**
* i2400m_bm_cmd - Execute a boot mode command
*
* @cmd: buffer containing the command data (pointing at the header).
* This data can be ANYWHERE (for USB, we will copy it to an
* specific buffer). Make sure everything is in proper little
* endian.
*
* A raw buffer can be also sent, just cast it and set flags to
* I2400M_BM_CMD_RAW.
*
* This function will generate a checksum for you if the
* checksum bit in the command is set (unless I2400M_BM_CMD_RAW
* is set).
*
* You can use the i2400m->bm_cmd_buf to stage your commands and
* send them.
*
* If NULL, no command is sent (we just wait for an ack).
*
* @cmd_size: size of the command. Will be auto padded to the
* bus-specific drivers padding requirements.
*
* @ack: buffer where to place the acknowledgement. If it is a regular
* command response, all fields will be returned with the right,
* native endianess.
*
* You *cannot* use i2400m->bm_ack_buf for this buffer.
*
* @ack_size: size of @ack, 16 aligned; you need to provide at least
* sizeof(*ack) bytes and then enough to contain the return data
* from the command
*
* @flags: see I2400M_BM_CMD_* above.
*
* @returns: bytes received by the notification; if < 0, an errno code
* denoting an error or:
*
* -ERESTARTSYS The device has rebooted
*
* Executes a boot-mode command and waits for a response, doing basic
* validation on it; if a zero length response is received, it retries
* waiting for a response until a non-zero one is received (timing out
* after %I2400M_BOOT_RETRIES retries).
*/
static
ssize_t i2400m_bm_cmd(struct i2400m *i2400m,
const struct i2400m_bootrom_header *cmd, size_t cmd_size,
struct i2400m_bootrom_header *ack, size_t ack_size,
int flags)
{
ssize_t result = -ENOMEM, rx_bytes;
struct device *dev = i2400m_dev(i2400m);
int opcode = cmd == NULL ? -1 : i2400m_brh_get_opcode(cmd);
d_fnstart(6, dev, "(i2400m %p cmd %p size %zu ack %p size %zu)\n",
i2400m, cmd, cmd_size, ack, ack_size);
BUG_ON(ack_size < sizeof(*ack));
BUG_ON(i2400m->boot_mode == 0);
if (cmd != NULL) { /* send the command */
result = i2400m->bus_bm_cmd_send(i2400m, cmd, cmd_size, flags);
if (result < 0)
goto error_cmd_send;
if ((flags & I2400M_BM_CMD_RAW) == 0)
d_printf(5, dev,
"boot-mode cmd %d csum %u rr %u da %u: "
"addr 0x%04x size %u block csum 0x%04x\n",
opcode, i2400m_brh_get_use_checksum(cmd),
i2400m_brh_get_response_required(cmd),
i2400m_brh_get_direct_access(cmd),
cmd->target_addr, cmd->data_size,
cmd->block_checksum);
}
result = i2400m->bus_bm_wait_for_ack(i2400m, ack, ack_size);
if (result < 0) {
dev_err(dev, "boot-mode cmd %d: error waiting for an ack: %d\n",
opcode, (int) result); /* bah, %zd doesn't work */
goto error_wait_for_ack;
}
rx_bytes = result;
/* verify the ack and read more if necessary [result is the
* final amount of bytes we get in the ack] */
result = __i2400m_bm_ack_verify(i2400m, opcode, ack, ack_size, flags);
if (result < 0)
goto error_bad_ack;
/* Don't you love this stack of empty targets? Well, I don't
* either, but it helps track exactly who comes in here and
* why :) */
result = rx_bytes;
error_bad_ack:
error_wait_for_ack:
error_cmd_send:
d_fnend(6, dev, "(i2400m %p cmd %p size %zu ack %p size %zu) = %d\n",
i2400m, cmd, cmd_size, ack, ack_size, (int) result);
return result;
}
示例3: wimax_dev_rm
/**
* wimax_dev_rm - Unregister an existing WiMAX device
*
* @wimax_dev: WiMAX device descriptor
*
* Unregisters a WiMAX device previously registered for use with
* wimax_add_rm().
*
* IMPORTANT! Must call before calling unregister_netdev().
*
* After this function returns, you will not get any more user space
* control requests (via netlink or debugfs) and thus to wimax_dev->ops.
*
* Reentrancy control is ensured by setting the state to
* %__WIMAX_ST_QUIESCING. rfkill operations coming through
* wimax_*rfkill*() will be stopped by the quiescing state; ops coming
* from the rfkill subsystem will be stopped by the support being
* removed by wimax_rfkill_rm().
*/
void wimax_dev_rm(struct wimax_dev *wimax_dev)
{
d_fnstart(3, NULL, "(wimax_dev %p)\n", wimax_dev);
mutex_lock(&wimax_dev->mutex);
__wimax_state_change(wimax_dev, __WIMAX_ST_QUIESCING);
wimax_debugfs_rm(wimax_dev);
wimax_id_table_rm(wimax_dev);
__wimax_state_change(wimax_dev, WIMAX_ST_DOWN);
mutex_unlock(&wimax_dev->mutex);
wimax_rfkill_rm(wimax_dev);
d_fnend(3, NULL, "(wimax_dev %p) = void\n", wimax_dev);
}
示例4: i2400mu_reset_resume
static
int i2400mu_reset_resume(struct usb_interface *iface)
{
int result;
struct device *dev = &iface->dev;
struct i2400mu *i2400mu = usb_get_intfdata(iface);
struct i2400m *i2400m = &i2400mu->i2400m;
d_fnstart(3, dev, "(iface %p)\n", iface);
result = i2400m_dev_reset_handle(i2400m, "device reset on resume");
d_fnend(3, dev, "(iface %p) = %d\n", iface, result);
return result < 0 ? result : 0;
}
示例5: i2400ms_rx_release
/*
* Tear down SDIO RX
*
* Disables IRQs in the device and removes the IRQ handler.
*/
void i2400ms_rx_release(struct i2400ms *i2400ms)
{
int result;
struct sdio_func *func = i2400ms->func;
struct device *dev = &func->dev;
d_fnstart(5, dev, "(i2400ms %p)\n", i2400ms);
sdio_claim_host(func);
sdio_writeb(func, 0, I2400MS_INTR_ENABLE_ADDR, &result);
sdio_release_irq(func);
sdio_release_host(func);
d_fnend(5, dev, "(i2400ms %p) = %d\n", i2400ms, result);
}
示例6: i2400mu_notification_release
/*
* Tear down of the notification mechanism
*
* @i2400m: device descriptor
*
* Kill the interrupt endpoint urb, free any allocated resources.
*
* We need to check if we have done it before as for example,
* _suspend() call this; if after a suspend() we get a _disconnect()
* (as the case is when hibernating), nothing bad happens.
*/
void i2400mu_notification_release(struct i2400mu *i2400mu)
{
struct device *dev = &i2400mu->usb_iface->dev;
d_fnstart(4, dev, "(i2400mu %p)\n", i2400mu);
if (i2400mu->notif_urb != NULL) {
usb_kill_urb(i2400mu->notif_urb);
kfree(i2400mu->notif_urb->transfer_buffer);
usb_free_urb(i2400mu->notif_urb);
i2400mu->notif_urb = NULL;
}
d_fnend(4, dev, "(i2400mu %p)\n", i2400mu);
}
示例7: i2400ms_rx
/*
* Read data from the device (when in normal)
*
* Allocate an SKB of the right size, read the data in and then
* deliver it to the generic layer.
*
* We also check for a reboot barker. That means the device died and
* we have to reboot it.
*/
static
void i2400ms_rx(struct i2400ms *i2400ms)
{
int ret;
struct sdio_func *func = i2400ms->func;
struct device *dev = &func->dev;
struct i2400m *i2400m = &i2400ms->i2400m;
struct sk_buff *skb;
ssize_t rx_size;
d_fnstart(7, dev, "(i2400ms %p)\n", i2400ms);
rx_size = __i2400ms_rx_get_size(i2400ms);
if (rx_size < 0) {
ret = rx_size;
goto error_get_size;
}
ret = -ENOMEM;
skb = alloc_skb(rx_size, GFP_ATOMIC);
if (NULL == skb) {
dev_err(dev, "RX: unable to alloc skb\n");
goto error_alloc_skb;
}
ret = sdio_memcpy_fromio(func, skb->data,
I2400MS_DATA_ADDR, rx_size);
if (ret < 0) {
dev_err(dev, "RX: SDIO data read failed: %d\n", ret);
goto error_memcpy_fromio;
}
/* Check if device has reset */
if (!memcmp(skb->data, i2400m_NBOOT_BARKER,
sizeof(i2400m_NBOOT_BARKER))
|| !memcmp(skb->data, i2400m_SBOOT_BARKER,
sizeof(i2400m_SBOOT_BARKER))) {
ret = i2400m_dev_reset_handle(i2400m);
kfree_skb(skb);
} else {
skb_put(skb, rx_size);
i2400m_rx(i2400m, skb);
}
d_fnend(7, dev, "(i2400ms %p) = void\n", i2400ms);
return;
error_memcpy_fromio:
kfree_skb(skb);
error_alloc_skb:
error_get_size:
d_fnend(7, dev, "(i2400ms %p) = %d\n", i2400ms, ret);
return;
}
示例8: i2400ms_enable_function
/*
* Enable the SDIO function
*
* Tries to enable the SDIO function; might fail if it is still not
* ready (in some hardware, the SDIO WiMAX function is only enabled
* when we ask it to explicitly doing). Tries until a timeout is
* reached.
*
* The @maxtries argument indicates how many times (at most) it should
* be tried to enable the function. 0 means forever. This acts along
* with the timeout (ie: it'll stop trying as soon as the maximum
* number of tries is reached _or_ as soon as the timeout is reached).
*
* The reverse of this is...sdio_disable_function()
*
* Returns: 0 if the SDIO function was enabled, < 0 errno code on
* error (-ENODEV when it was unable to enable the function).
*/
static
int i2400ms_enable_function(struct i2400ms *i2400ms, unsigned maxtries)
{
struct sdio_func *func = i2400ms->func;
u64 timeout;
int err;
struct device *dev = &func->dev;
unsigned tries = 0;
d_fnstart(3, dev, "(func %p)\n", func);
/* Setup timeout (FIXME: This needs to read the CIS table to
* get a real timeout) and then wait for the device to signal
* it is ready */
timeout = get_jiffies_64() + ioe_timeout * HZ;
err = -ENODEV;
while (err != 0 && time_before64(get_jiffies_64(), timeout)) {
sdio_claim_host(func);
/*
* There is a sillicon bug on the IWMC3200, where the
* IOE timeout will cause problems on Moorestown
* platforms (system hang). We explicitly overwrite
* func->enable_timeout here to work around the issue.
*/
if (i2400ms->iwmc3200)
func->enable_timeout = IWMC3200_IOR_TIMEOUT;
err = sdio_enable_func(func);
if (0 == err) {
sdio_release_host(func);
d_printf(2, dev, "SDIO function enabled\n");
goto function_enabled;
}
d_printf(2, dev, "SDIO function failed to enable: %d\n", err);
sdio_release_host(func);
if (maxtries > 0 && ++tries >= maxtries) {
err = -ETIME;
break;
}
msleep(I2400MS_INIT_SLEEP_INTERVAL);
}
/* If timed out, device is not there yet -- get -ENODEV so
* the device driver core will retry later on. */
if (err == -ETIME) {
dev_err(dev, "Can't enable WiMAX function; "
" has the function been enabled?\n");
err = -ENODEV;
}
function_enabled:
d_fnend(3, dev, "(func %p) = %d\n", func, err);
return err;
}
示例9: i2400m_dnload_finalize
/*
* Do the final steps of uploading firmware
*
* @bcf_hdr: BCF header we are actually using
* @bcf: pointer to the firmware image (which matches the first header
* that is followed by the actual payloads).
* @offset: [byte] offset into @bcf for the command we need to send.
*
* Depending on the boot mode (signed vs non-signed), different
* actions need to be taken.
*/
static
int i2400m_dnload_finalize(struct i2400m *i2400m,
const struct i2400m_bcf_hdr *bcf_hdr,
const struct i2400m_bcf_hdr *bcf, size_t offset)
{
int ret = 0;
struct device *dev = i2400m_dev(i2400m);
struct i2400m_bootrom_header *cmd, ack;
struct {
struct i2400m_bootrom_header cmd;
u8 cmd_pl[0];
} __packed *cmd_buf;
size_t signature_block_offset, signature_block_size;
d_fnstart(3, dev, "offset %zu\n", offset);
cmd = (void *) bcf + offset;
if (i2400m_boot_is_signed(i2400m) == 0) {
struct i2400m_bootrom_header jump_ack;
d_printf(1, dev, "unsecure boot, jumping to 0x%08x\n",
le32_to_cpu(cmd->target_addr));
cmd_buf = i2400m->bm_cmd_buf;
memcpy(&cmd_buf->cmd, cmd, sizeof(*cmd));
cmd = &cmd_buf->cmd;
/* now cmd points to the actual bootrom_header in cmd_buf */
i2400m_brh_set_opcode(cmd, I2400M_BRH_JUMP);
cmd->data_size = 0;
ret = i2400m_bm_cmd(i2400m, cmd, sizeof(*cmd),
&jump_ack, sizeof(jump_ack), 0);
} else {
d_printf(1, dev, "secure boot, jumping to 0x%08x\n",
le32_to_cpu(cmd->target_addr));
cmd_buf = i2400m->bm_cmd_buf;
memcpy(&cmd_buf->cmd, cmd, sizeof(*cmd));
signature_block_offset =
sizeof(*bcf_hdr)
+ le32_to_cpu(bcf_hdr->key_size) * sizeof(u32)
+ le32_to_cpu(bcf_hdr->exponent_size) * sizeof(u32);
signature_block_size =
le32_to_cpu(bcf_hdr->modulus_size) * sizeof(u32);
memcpy(cmd_buf->cmd_pl,
(void *) bcf_hdr + signature_block_offset,
signature_block_size);
ret = i2400m_bm_cmd(i2400m, &cmd_buf->cmd,
sizeof(cmd_buf->cmd) + signature_block_size,
&ack, sizeof(ack), I2400M_BM_CMD_RAW);
}
d_fnend(3, dev, "returning %d\n", ret);
return ret;
}
示例10: i2400m_report_state_hook
/*
* Parse a 'state report' and extract carrier on/off information
*
* @i2400m: device descriptor
* @l3l4_hdr: pointer to message; it has been already validated for
* consistent size.
* @size: size of the message (header + payload). The header length
* declaration is assumed to be congruent with @size (as in
* sizeof(*l3l4_hdr) + l3l4_hdr->length == size)
*
* Extract from the report state the system state TLV and infer from
* there if we have a carrier or not. Update our local state and tell
* netdev.
*
* When setting the carrier, it's fine to set OFF twice (for example),
* as netif_carrier_off() will not generate two OFF events (just on
* the transitions).
*/
static
void i2400m_report_state_hook(struct i2400m *i2400m,
const struct i2400m_l3l4_hdr *l3l4_hdr,
size_t size, const char *tag)
{
struct device *dev = i2400m_dev(i2400m);
const struct i2400m_tlv_hdr *tlv;
const struct i2400m_tlv_system_state *ss;
const struct i2400m_tlv_rf_switches_status *rfss;
const struct i2400m_tlv_media_status *ms;
size_t tlv_size = le16_to_cpu(l3l4_hdr->length);
d_fnstart(4, dev, "(i2400m %p, l3l4_hdr %p, size %zu, %s)\n",
i2400m, l3l4_hdr, size, tag);
tlv = NULL;
while ((tlv = i2400m_tlv_buffer_walk(i2400m, &l3l4_hdr->pl,
tlv_size, tlv))) {
if (0 == i2400m_tlv_match(tlv, I2400M_TLV_SYSTEM_STATE,
sizeof(*ss))) {
ss = container_of(tlv, typeof(*ss), hdr);
d_printf(2, dev, "%s: system state TLV "
"found (0x%04x), state 0x%08x\n",
tag, I2400M_TLV_SYSTEM_STATE,
le32_to_cpu(ss->state));
i2400m_report_tlv_system_state(i2400m, ss);
}
if (0 == i2400m_tlv_match(tlv, I2400M_TLV_RF_STATUS,
sizeof(*rfss))) {
rfss = container_of(tlv, typeof(*rfss), hdr);
d_printf(2, dev, "%s: RF status TLV "
"found (0x%04x), sw 0x%02x hw 0x%02x\n",
tag, I2400M_TLV_RF_STATUS,
le32_to_cpu(rfss->sw_rf_switch),
le32_to_cpu(rfss->hw_rf_switch));
i2400m_report_tlv_rf_switches_status(i2400m, rfss);
}
if (0 == i2400m_tlv_match(tlv, I2400M_TLV_MEDIA_STATUS,
sizeof(*ms))) {
ms = container_of(tlv, typeof(*ms), hdr);
d_printf(2, dev, "%s: Media Status TLV: %u\n",
tag, le32_to_cpu(ms->media_status));
i2400m_report_tlv_media_status(i2400m, ms);
}
}
d_fnend(4, dev, "(i2400m %p, l3l4_hdr %p, size %zu, %s) = void\n",
i2400m, l3l4_hdr, size, tag);
}
示例11: wimax_subsys_init
/* Shutdown the wimax stack */
static
int __init wimax_subsys_init(void)
{
int result, cnt;
d_fnstart(4, NULL, "()\n");
d_parse_params(D_LEVEL, D_LEVEL_SIZE, wimax_debug_params,
"wimax.debug");
snprintf(wimax_gnl_family.name, sizeof(wimax_gnl_family.name),
"WiMAX");
result = genl_register_family(&wimax_gnl_family);
if (unlikely(result < 0)) {
printk(KERN_ERR "cannot register generic netlink family: %d\n",
result);
goto error_register_family;
}
for (cnt = 0; cnt < ARRAY_SIZE(wimax_gnl_ops); cnt++) {
result = genl_register_ops(&wimax_gnl_family,
wimax_gnl_ops[cnt]);
d_printf(4, NULL, "registering generic netlink op code "
"%u: %d\n", wimax_gnl_ops[cnt]->cmd, result);
if (unlikely(result < 0)) {
printk(KERN_ERR "cannot register generic netlink op "
"code %u: %d\n",
wimax_gnl_ops[cnt]->cmd, result);
goto error_register_ops;
}
}
result = genl_register_mc_group(&wimax_gnl_family, &wimax_gnl_mcg);
if (result < 0)
goto error_mc_group;
d_fnend(4, NULL, "() = 0\n");
return 0;
error_mc_group:
error_register_ops:
for (cnt--; cnt >= 0; cnt--)
genl_unregister_ops(&wimax_gnl_family,
wimax_gnl_ops[cnt]);
genl_unregister_family(&wimax_gnl_family);
error_register_family:
d_fnend(4, NULL, "() = %d\n", result);
return result;
}
示例12: i2400ms_bus_bm_cmd_send
ssize_t i2400ms_bus_bm_cmd_send(struct i2400m *i2400m,
const struct i2400m_bootrom_header *_cmd,
size_t cmd_size, int flags)
{
ssize_t result;
struct device *dev = i2400m_dev(i2400m);
struct i2400ms *i2400ms = container_of(i2400m, struct i2400ms, i2400m);
int opcode = _cmd == NULL ? -1 : i2400m_brh_get_opcode(_cmd);
struct i2400m_bootrom_header *cmd;
size_t cmd_size_a = ALIGN(cmd_size, I2400MS_BLK_SIZE);
d_fnstart(5, dev, "(i2400m %p cmd %p size %zu)\n",
i2400m, _cmd, cmd_size);
result = -E2BIG;
if (cmd_size > I2400M_BM_CMD_BUF_SIZE)
goto error_too_big;
if (_cmd != i2400m->bm_cmd_buf)
memmove(i2400m->bm_cmd_buf, _cmd, cmd_size);
cmd = i2400m->bm_cmd_buf;
if (cmd_size_a > cmd_size)
memset(i2400m->bm_cmd_buf + cmd_size, 0, cmd_size_a - cmd_size);
if ((flags & I2400M_BM_CMD_RAW) == 0) {
if (WARN_ON(i2400m_brh_get_response_required(cmd) == 0))
dev_warn(dev, "SW BUG: response_required == 0\n");
i2400m_bm_cmd_prepare(cmd);
}
d_printf(4, dev, "BM cmd %d: %zu bytes (%zu padded)\n",
opcode, cmd_size, cmd_size_a);
d_dump(5, dev, cmd, cmd_size);
sdio_claim_host(i2400ms->func);
result = sdio_memcpy_toio(i2400ms->func, I2400MS_DATA_ADDR,
i2400m->bm_cmd_buf, cmd_size_a);
sdio_release_host(i2400ms->func);
if (result < 0) {
dev_err(dev, "BM cmd %d: cannot send: %ld\n",
opcode, (long) result);
goto error_cmd_send;
}
result = cmd_size;
error_cmd_send:
error_too_big:
d_fnend(5, dev, "(i2400m %p cmd %p size %zu) = %d\n",
i2400m, _cmd, cmd_size, (int) result);
return result;
}
示例13: i2400ms_remove
static
void i2400ms_remove(struct sdio_func *func)
{
struct device *dev = &func->dev;
struct i2400ms *i2400ms = sdio_get_drvdata(func);
struct i2400m *i2400m = &i2400ms->i2400m;
struct net_device *net_dev = i2400m->wimax_dev.net_dev;
d_fnstart(3, dev, "SDIO func %p\n", func);
debugfs_remove_recursive(i2400ms->debugfs_dentry);
i2400ms->debugfs_dentry = NULL;
i2400m_release(i2400m);
sdio_set_drvdata(func, NULL);
free_netdev(net_dev);
d_fnend(3, dev, "SDIO func %p\n", func);
}
示例14: i2400m_open
static
int i2400m_open(struct net_device *net_dev)
{
int result;
struct i2400m *i2400m = net_dev_to_i2400m(net_dev);
struct device *dev = i2400m_dev(i2400m);
d_fnstart(3, dev, "(net_dev %p [i2400m %p])\n", net_dev, i2400m);
if (i2400m->ready == 0) {
dev_err(dev, "Device is still initializing\n");
result = -EBUSY;
} else
result = 0;
d_fnend(3, dev, "(net_dev %p [i2400m %p]) = %d\n",
net_dev, i2400m, result);
return result;
}
示例15: i2400mu_disconnect
/*
* Disconect a i2400m from the system.
*
* i2400m_stop() has been called before, so al the rx and tx contexts
* have been taken down already. Make sure the queue is stopped,
* unregister netdev and i2400m, free and kill.
*/
static
void i2400mu_disconnect(struct usb_interface *iface)
{
struct i2400mu *i2400mu = usb_get_intfdata(iface);
struct i2400m *i2400m = &i2400mu->i2400m;
struct net_device *net_dev = i2400m->wimax_dev.net_dev;
struct device *dev = &iface->dev;
d_fnstart(3, dev, "(iface %p i2400m %p)\n", iface, i2400m);
debugfs_remove_recursive(i2400mu->debugfs_dentry);
i2400m_release(i2400m);
usb_set_intfdata(iface, NULL);
usb_put_dev(i2400mu->usb_dev);
free_netdev(net_dev);
d_fnend(3, dev, "(iface %p i2400m %p) = void\n", iface, i2400m);
}