• Home
  • Raw
  • Download

Lines Matching refs:opts

968 	const struct ndp_parser_opts *opts = ncm->parser_opts;  in package_for_tx()  local
970 const int dgram_idx_len = 2 * 2 * opts->dgram_item_len; in package_for_tx()
984 put_ncm(&ntb_iter, opts->block_length, new_len); in package_for_tx()
985 put_ncm(&ntb_iter, opts->ndp_index, ndp_index); in package_for_tx()
988 new_len = opts->ndp_size + in package_for_tx()
1028 const struct ndp_parser_opts *opts = ncm->parser_opts; in ncm_wrap_ntb() local
1032 const int dgram_idx_len = 2 * 2 * opts->dgram_item_len; in ncm_wrap_ntb()
1067 ncb_len = opts->nth_size; in ncm_wrap_ntb()
1079 put_unaligned_le32(opts->nth_sign, ntb_data); in ncm_wrap_ntb()
1082 put_unaligned_le16(opts->nth_size, ntb_data++); in ncm_wrap_ntb()
1088 ncm->skb_tx_ndp = alloc_skb((int)(opts->ndp_size in ncm_wrap_ntb()
1089 + opts->dpe_size in ncm_wrap_ntb()
1096 ntb_ndp = skb_put(ncm->skb_tx_ndp, opts->ndp_size); in ncm_wrap_ntb()
1120 put_ncm(&ntb_ndp, opts->dgram_item_len, ncb_len); in ncm_wrap_ntb()
1122 put_ncm(&ntb_ndp, opts->dgram_item_len, skb->len); in ncm_wrap_ntb()
1194 const struct ndp_parser_opts *opts = ncm->parser_opts; in ncm_unwrap_ntb() local
1203 if (get_unaligned_le32(tmp) != opts->nth_sign) { in ncm_unwrap_ntb()
1213 if (get_unaligned_le16(tmp++) != opts->nth_size) { in ncm_unwrap_ntb()
1219 block_len = get_ncm(&tmp, opts->block_length); in ncm_unwrap_ntb()
1226 ndp_index = get_ncm(&tmp, opts->ndp_index); in ncm_unwrap_ntb()
1235 (ndp_index < opts->nth_size) || in ncm_unwrap_ntb()
1237 opts->ndp_size))) { in ncm_unwrap_ntb()
1263 if ((ndp_len < opts->ndp_size in ncm_unwrap_ntb()
1264 + 2 * 2 * (opts->dgram_item_len * 2)) || in ncm_unwrap_ntb()
1265 (ndp_len % opts->ndplen_align != 0)) { in ncm_unwrap_ntb()
1270 tmp += opts->reserved1; in ncm_unwrap_ntb()
1272 ndp_index = get_ncm(&tmp, opts->next_ndp_index); in ncm_unwrap_ntb()
1273 tmp += opts->reserved2; in ncm_unwrap_ntb()
1275 ndp_len -= opts->ndp_size; in ncm_unwrap_ntb()
1276 index2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1277 dg_len2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1283 if ((index < opts->nth_size) || in ncm_unwrap_ntb()
1284 (index > block_len - opts->dpe_size)) { in ncm_unwrap_ntb()
1317 index2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1318 dg_len2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1321 if (index2 > block_len - opts->dpe_size) { in ncm_unwrap_ntb()
1340 ndp_len -= 2 * (opts->dgram_item_len * 2); in ncm_unwrap_ntb()
1345 } while (ndp_len > 2 * (opts->dgram_item_len * 2)); in ncm_unwrap_ntb()
1630 struct f_ncm_opts *opts; in ncm_free_inst() local
1632 opts = container_of(f, struct f_ncm_opts, func_inst); in ncm_free_inst()
1633 if (opts->bound) in ncm_free_inst()
1634 gether_cleanup(netdev_priv(opts->net)); in ncm_free_inst()
1636 free_netdev(opts->net); in ncm_free_inst()
1637 kfree(opts->ncm_interf_group); in ncm_free_inst()
1638 kfree(opts); in ncm_free_inst()
1643 struct f_ncm_opts *opts; in ncm_alloc_inst() local
1648 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in ncm_alloc_inst()
1649 if (!opts) in ncm_alloc_inst()
1651 opts->ncm_os_desc.ext_compat_id = opts->ncm_ext_compat_id; in ncm_alloc_inst()
1653 mutex_init(&opts->lock); in ncm_alloc_inst()
1654 opts->func_inst.free_func_inst = ncm_free_inst; in ncm_alloc_inst()
1655 opts->net = gether_setup_default(); in ncm_alloc_inst()
1656 if (IS_ERR(opts->net)) { in ncm_alloc_inst()
1657 struct net_device *net = opts->net; in ncm_alloc_inst()
1658 kfree(opts); in ncm_alloc_inst()
1661 INIT_LIST_HEAD(&opts->ncm_os_desc.ext_prop); in ncm_alloc_inst()
1663 descs[0] = &opts->ncm_os_desc; in ncm_alloc_inst()
1666 config_group_init_type_name(&opts->func_inst.group, "", &ncm_func_type); in ncm_alloc_inst()
1668 usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs, in ncm_alloc_inst()
1671 ncm_free_inst(&opts->func_inst); in ncm_alloc_inst()
1674 opts->ncm_interf_group = ncm_interf_group; in ncm_alloc_inst()
1676 return &opts->func_inst; in ncm_alloc_inst()
1682 struct f_ncm_opts *opts; in ncm_free() local
1685 opts = container_of(f->fi, struct f_ncm_opts, func_inst); in ncm_free()
1687 mutex_lock(&opts->lock); in ncm_free()
1688 opts->refcnt--; in ncm_free()
1689 mutex_unlock(&opts->lock); in ncm_free()
1718 struct f_ncm_opts *opts; in ncm_alloc() local
1726 opts = container_of(fi, struct f_ncm_opts, func_inst); in ncm_alloc()
1727 mutex_lock(&opts->lock); in ncm_alloc()
1728 opts->refcnt++; in ncm_alloc()
1731 status = gether_get_host_addr_cdc(opts->net, ncm->ethaddr, in ncm_alloc()
1735 mutex_unlock(&opts->lock); in ncm_alloc()
1742 ncm->port.ioport = netdev_priv(opts->net); in ncm_alloc()
1743 mutex_unlock(&opts->lock); in ncm_alloc()