Section: 5.15.1.1 Resource allocation
Content: In order to transmit MAC PDU(s) on SL-DCH, the MAC entity shall for every discovery period and each MAC PDU: - if the MAC entity is configured by upper layers with a specific grant as specified in TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ]  [8]: - using the specific grant determine the set of subframes in which a transmission of new MAC PDU(s) occur according to clause 14.3.1 of TS 36.213[ Evolved Universal Terrestrial Radio Access (E-UTRA); Physical layer procedures ]  [2]; - consider the determined set of subframes to be a configured grant for the corresponding discovery period; - for every subframe, if the MAC entity has a configured grant occurring in that subframe, deliver the configured grant and the MAC PDU to the Sidelink HARQ Entity; - clear the configured grant at the end of the corresponding discovery period. NOTE: Mapping between grant and physical resources is specified in clause 9.5.6 of TS 36.211[ Evolved Universal Terrestrial Radio Access (E-UTRA); Physical channels and modulation ]  [7]. - else if the MAC entity is configured with a single pool of resources by upper layers: - select a random value p1 in the range from 0 to 1, where the random function shall be such that each of the allowed selections can be chosen with equal probability; - if p1 is less than txProbability: - select a random resource from the pool of resources (excluding any resources which are overlapping with PRACH or resources belonging to the subframes of resources already selected for transmissions on SL-DCH in this discovery period), where the random function shall be such that each of the allowed selections (see clause 14.3.1 of TS 36.213[ Evolved Universal Terrestrial Radio Access (E-UTRA); Physical layer procedures ]  [2]) can be chosen with equal probability; - using the selected resource determine the set of subframes in which the transmission of a MAC PDU can occur according to clause 14.3.1 of TS 36.213[ Evolved Universal Terrestrial Radio Access (E-UTRA); Physical layer procedures ]  [2] - consider the determined set of subframes to be a configured grant for the corresponding discovery period; - for every subframe, if the MAC entity has a configured grant occurring in that subframe, deliver the configured grant and the MAC PDU to the Sidelink HARQ Entity; - clear the configured grant at the end of the corresponding discovery period.