[balbi-usb:testing/next 6/16] drivers/usb/gadget/function/f_ncm.c:1105:10: error: 'HRTIMER_MODE_REL_SOFT' undeclared; did you mean 'HRTIMER_MODE_REL'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git testing/next
head:   4929fb631d4cedc385910fd998518e22bd71d680
commit: 562d8eeed9a6bb9ca3370a3f75d96f0e7ba0a059 [6/16] usb/gadget/NCM: Replace tasklet with softirq hrtimer
config: i386-randconfig-x073-201749 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
        git checkout 562d8eeed9a6bb9ca3370a3f75d96f0e7ba0a059
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/usb/gadget/function/f_ncm.c: In function 'ncm_wrap_ntb':
>> drivers/usb/gadget/function/f_ncm.c:1105:10: error: 'HRTIMER_MODE_REL_SOFT' undeclared (first use in this function); did you mean 'HRTIMER_MODE_REL'?
             HRTIMER_MODE_REL_SOFT);
             ^~~~~~~~~~~~~~~~~~~~~
             HRTIMER_MODE_REL
   drivers/usb/gadget/function/f_ncm.c:1105:10: note: each undeclared identifier is reported only once for each function it appears in
   drivers/usb/gadget/function/f_ncm.c: In function 'ncm_bind':
   drivers/usb/gadget/function/f_ncm.c:1502:50: error: 'HRTIMER_MODE_REL_SOFT' undeclared (first use in this function); did you mean 'HRTIMER_MODE_REL'?
     hrtimer_init(&ncm->task_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
                                                     ^~~~~~~~~~~~~~~~~~~~~
                                                     HRTIMER_MODE_REL

vim +1105 drivers/usb/gadget/function/f_ncm.c

  1011	
  1012	static struct sk_buff *ncm_wrap_ntb(struct gether *port,
  1013					    struct sk_buff *skb)
  1014	{
  1015		struct f_ncm	*ncm = func_to_ncm(&port->func);
  1016		struct sk_buff	*skb2 = NULL;
  1017		int		ncb_len = 0;
  1018		__le16		*ntb_data;
  1019		__le16		*ntb_ndp;
  1020		int		dgram_pad;
  1021	
  1022		unsigned	max_size = ncm->port.fixed_in_len;
  1023		const struct ndp_parser_opts *opts = ncm->parser_opts;
  1024		const int ndp_align = le16_to_cpu(ntb_parameters.wNdpInAlignment);
  1025		const int div = le16_to_cpu(ntb_parameters.wNdpInDivisor);
  1026		const int rem = le16_to_cpu(ntb_parameters.wNdpInPayloadRemainder);
  1027		const int dgram_idx_len = 2 * 2 * opts->dgram_item_len;
  1028	
  1029		if (!skb && !ncm->skb_tx_data)
  1030			return NULL;
  1031	
  1032		if (skb) {
  1033			/* Add the CRC if required up front */
  1034			if (ncm->is_crc) {
  1035				uint32_t	crc;
  1036				__le16		*crc_pos;
  1037	
  1038				crc = ~crc32_le(~0,
  1039						skb->data,
  1040						skb->len);
  1041				crc_pos = skb_put(skb, sizeof(uint32_t));
  1042				put_unaligned_le32(crc, crc_pos);
  1043			}
  1044	
  1045			/* If the new skb is too big for the current NCM NTB then
  1046			 * set the current stored skb to be sent now and clear it
  1047			 * ready for new data.
  1048			 * NOTE: Assume maximum align for speed of calculation.
  1049			 */
  1050			if (ncm->skb_tx_data
  1051			    && (ncm->ndp_dgram_count >= TX_MAX_NUM_DPE
  1052			    || (ncm->skb_tx_data->len +
  1053			    div + rem + skb->len +
  1054			    ncm->skb_tx_ndp->len + ndp_align + (2 * dgram_idx_len))
  1055			    > max_size)) {
  1056				skb2 = package_for_tx(ncm);
  1057				if (!skb2)
  1058					goto err;
  1059			}
  1060	
  1061			if (!ncm->skb_tx_data) {
  1062				ncb_len = opts->nth_size;
  1063				dgram_pad = ALIGN(ncb_len, div) + rem - ncb_len;
  1064				ncb_len += dgram_pad;
  1065	
  1066				/* Create a new skb for the NTH and datagrams. */
  1067				ncm->skb_tx_data = alloc_skb(max_size, GFP_ATOMIC);
  1068				if (!ncm->skb_tx_data)
  1069					goto err;
  1070	
  1071				ncm->skb_tx_data->dev = ncm->netdev;
  1072				ntb_data = skb_put_zero(ncm->skb_tx_data, ncb_len);
  1073				/* dwSignature */
  1074				put_unaligned_le32(opts->nth_sign, ntb_data);
  1075				ntb_data += 2;
  1076				/* wHeaderLength */
  1077				put_unaligned_le16(opts->nth_size, ntb_data++);
  1078	
  1079				/* Allocate an skb for storing the NDP,
  1080				 * TX_MAX_NUM_DPE should easily suffice for a
  1081				 * 16k packet.
  1082				 */
  1083				ncm->skb_tx_ndp = alloc_skb((int)(opts->ndp_size
  1084							    + opts->dpe_size
  1085							    * TX_MAX_NUM_DPE),
  1086							    GFP_ATOMIC);
  1087				if (!ncm->skb_tx_ndp)
  1088					goto err;
  1089	
  1090				ncm->skb_tx_ndp->dev = ncm->netdev;
  1091				ntb_ndp = skb_put(ncm->skb_tx_ndp, opts->ndp_size);
  1092				memset(ntb_ndp, 0, ncb_len);
  1093				/* dwSignature */
  1094				put_unaligned_le32(ncm->ndp_sign, ntb_ndp);
  1095				ntb_ndp += 2;
  1096	
  1097				/* There is always a zeroed entry */
  1098				ncm->ndp_dgram_count = 1;
  1099	
  1100				/* Note: we skip opts->next_ndp_index */
  1101			}
  1102	
  1103			/* Delay the timer. */
  1104			hrtimer_start(&ncm->task_timer, TX_TIMEOUT_NSECS,
> 1105				      HRTIMER_MODE_REL_SOFT);
  1106	
  1107			/* Add the datagram position entries */
  1108			ntb_ndp = skb_put_zero(ncm->skb_tx_ndp, dgram_idx_len);
  1109	
  1110			ncb_len = ncm->skb_tx_data->len;
  1111			dgram_pad = ALIGN(ncb_len, div) + rem - ncb_len;
  1112			ncb_len += dgram_pad;
  1113	
  1114			/* (d)wDatagramIndex */
  1115			put_ncm(&ntb_ndp, opts->dgram_item_len, ncb_len);
  1116			/* (d)wDatagramLength */
  1117			put_ncm(&ntb_ndp, opts->dgram_item_len, skb->len);
  1118			ncm->ndp_dgram_count++;
  1119	
  1120			/* Add the new data to the skb */
  1121			skb_put_zero(ncm->skb_tx_data, dgram_pad);
  1122			skb_put_data(ncm->skb_tx_data, skb->data, skb->len);
  1123			dev_consume_skb_any(skb);
  1124			skb = NULL;
  1125	
  1126		} else if (ncm->skb_tx_data && ncm->timer_force_tx) {
  1127			/* If the tx was requested because of a timeout then send */
  1128			skb2 = package_for_tx(ncm);
  1129			if (!skb2)
  1130				goto err;
  1131		}
  1132	
  1133		return skb2;
  1134	
  1135	err:
  1136		ncm->netdev->stats.tx_dropped++;
  1137	
  1138		if (skb)
  1139			dev_kfree_skb_any(skb);
  1140		if (ncm->skb_tx_data)
  1141			dev_kfree_skb_any(ncm->skb_tx_data);
  1142		if (ncm->skb_tx_ndp)
  1143			dev_kfree_skb_any(ncm->skb_tx_ndp);
  1144	
  1145		return NULL;
  1146	}
  1147	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux