On Mon, 6 Dec 2021, Ricardo Martinez wrote: > From: Haijun Liu <haijun.liu@xxxxxxxxxxxx> > > Control Port implements driver control messages such as modem-host > handshaking, controls port enumeration, and handles exception messages. > > The handshaking process between the driver and the modem happens during > the init sequence. The process involves the exchange of a list of > supported runtime features to make sure that modem and host are ready > to provide proper feature lists including port enumeration. Further > features can be enabled and controlled in this handshaking process. > > Signed-off-by: Haijun Liu <haijun.liu@xxxxxxxxxxxx> > Signed-off-by: Chandrashekar Devegowda <chandrashekar.devegowda@xxxxxxxxx> > Co-developed-by: Ricardo Martinez <ricardo.martinez@xxxxxxxxxxxxxxx> > Signed-off-by: Ricardo Martinez <ricardo.martinez@xxxxxxxxxxxxxxx> > + ccci_h->packet_header = 0; > + ccci_h->packet_len = cpu_to_le32(packet_size); > + ccci_h->status &= cpu_to_le32(~HDR_FLD_CHN); > + ccci_h->status |= cpu_to_le32(FIELD_PREP(HDR_FLD_CHN, port_static->tx_ch)); > + ccci_h->status &= cpu_to_le32(~HDR_FLD_SEQ); > + ccci_h->ex_msg = 0; ... > + ccci_h->packet_header = cpu_to_le32(CCCI_HEADER_NO_DATA); > + ccci_h->packet_len = cpu_to_le32(sizeof(*ctrl_msg_h) + CCCI_H_LEN); > + ccci_h->status &= cpu_to_le32(~HDR_FLD_CHN); > + ccci_h->status |= cpu_to_le32(FIELD_PREP(HDR_FLD_CHN, ch)); > + ccci_h->ex_msg = 0; ... > + ccci_h->packet_header = cpu_to_le32(CCCI_HEADER_NO_DATA); > + ccci_h->packet_len = cpu_to_le32(msg); > + ccci_h->status &= cpu_to_le32(~HDR_FLD_CHN); > + ccci_h->status |= cpu_to_le32(FIELD_PREP(HDR_FLD_CHN, ch)); > + ccci_h->ex_msg = cpu_to_le32(ex_msg); A helper to handle the common part of ccci_h init would be useful. -- i.