Lines Matching refs:opts
896 const struct ndp_parser_opts *opts = ncm->parser_opts; in package_for_tx() local
898 const int dgram_idx_len = 2 * 2 * opts->dgram_item_len; in package_for_tx()
912 put_ncm(&ntb_iter, opts->block_length, new_len); in package_for_tx()
913 put_ncm(&ntb_iter, opts->ndp_index, ndp_index); in package_for_tx()
916 new_len = opts->ndp_size + in package_for_tx()
959 const struct ndp_parser_opts *opts = ncm->parser_opts; in ncm_wrap_ntb() local
963 const int dgram_idx_len = 2 * 2 * opts->dgram_item_len; in ncm_wrap_ntb()
998 ncb_len = opts->nth_size; in ncm_wrap_ntb()
1010 put_unaligned_le32(opts->nth_sign, ntb_data); in ncm_wrap_ntb()
1013 put_unaligned_le16(opts->nth_size, ntb_data++); in ncm_wrap_ntb()
1019 ncm->skb_tx_ndp = alloc_skb((int)(opts->ndp_size in ncm_wrap_ntb()
1020 + opts->dpe_size in ncm_wrap_ntb()
1026 opts->ndp_size); in ncm_wrap_ntb()
1052 put_ncm(&ntb_ndp, opts->dgram_item_len, ncb_len); in ncm_wrap_ntb()
1054 put_ncm(&ntb_ndp, opts->dgram_item_len, skb->len); in ncm_wrap_ntb()
1137 const struct ndp_parser_opts *opts = ncm->parser_opts; in ncm_unwrap_ntb() local
1142 if (get_unaligned_le32(tmp) != opts->nth_sign) { in ncm_unwrap_ntb()
1152 if (get_unaligned_le16(tmp++) != opts->nth_size) { in ncm_unwrap_ntb()
1159 if (get_ncm(&tmp, opts->block_length) > max_size) { in ncm_unwrap_ntb()
1164 ndp_index = get_ncm(&tmp, opts->ndp_index); in ncm_unwrap_ntb()
1170 (ndp_index < opts->nth_size)) { in ncm_unwrap_ntb()
1192 if ((ndp_len < opts->ndp_size in ncm_unwrap_ntb()
1193 + 2 * 2 * (opts->dgram_item_len * 2)) in ncm_unwrap_ntb()
1194 || (ndp_len % opts->ndplen_align != 0)) { in ncm_unwrap_ntb()
1199 tmp += opts->reserved1; in ncm_unwrap_ntb()
1201 ndp_index = get_ncm(&tmp, opts->next_ndp_index); in ncm_unwrap_ntb()
1202 tmp += opts->reserved2; in ncm_unwrap_ntb()
1204 ndp_len -= opts->ndp_size; in ncm_unwrap_ntb()
1205 index2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1206 dg_len2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1233 index2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1234 dg_len2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1249 ndp_len -= 2 * (opts->dgram_item_len * 2); in ncm_unwrap_ntb()
1255 } while (ndp_len > 2 * (opts->dgram_item_len * 2)); in ncm_unwrap_ntb()
1506 struct f_ncm_opts *opts; in ncm_free_inst() local
1508 opts = container_of(f, struct f_ncm_opts, func_inst); in ncm_free_inst()
1509 if (opts->bound) in ncm_free_inst()
1510 gether_cleanup(netdev_priv(opts->net)); in ncm_free_inst()
1512 free_netdev(opts->net); in ncm_free_inst()
1513 kfree(opts); in ncm_free_inst()
1518 struct f_ncm_opts *opts; in ncm_alloc_inst() local
1520 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in ncm_alloc_inst()
1521 if (!opts) in ncm_alloc_inst()
1523 mutex_init(&opts->lock); in ncm_alloc_inst()
1524 opts->func_inst.free_func_inst = ncm_free_inst; in ncm_alloc_inst()
1525 opts->net = gether_setup_default(); in ncm_alloc_inst()
1526 if (IS_ERR(opts->net)) { in ncm_alloc_inst()
1527 struct net_device *net = opts->net; in ncm_alloc_inst()
1528 kfree(opts); in ncm_alloc_inst()
1532 config_group_init_type_name(&opts->func_inst.group, "", &ncm_func_type); in ncm_alloc_inst()
1534 return &opts->func_inst; in ncm_alloc_inst()
1540 struct f_ncm_opts *opts; in ncm_free() local
1543 opts = container_of(f->fi, struct f_ncm_opts, func_inst); in ncm_free()
1545 mutex_lock(&opts->lock); in ncm_free()
1546 opts->refcnt--; in ncm_free()
1547 mutex_unlock(&opts->lock); in ncm_free()
1569 struct f_ncm_opts *opts; in ncm_alloc() local
1577 opts = container_of(fi, struct f_ncm_opts, func_inst); in ncm_alloc()
1578 mutex_lock(&opts->lock); in ncm_alloc()
1579 opts->refcnt++; in ncm_alloc()
1582 status = gether_get_host_addr_cdc(opts->net, ncm->ethaddr, in ncm_alloc()
1586 mutex_unlock(&opts->lock); in ncm_alloc()
1593 ncm->port.ioport = netdev_priv(opts->net); in ncm_alloc()
1594 mutex_unlock(&opts->lock); in ncm_alloc()