Commit b5aca5fd authored by Joanne Hugé's avatar Joanne Hugé

wip: looks OK in wireshark

parent cf65bc2b
...@@ -199,7 +199,7 @@ typedef struct { ...@@ -199,7 +199,7 @@ typedef struct {
uint8_t seq_id; uint8_t seq_id;
uint8_t seq_id_fixed; uint8_t seq_id_fixed;
uint8_t oran_header[ORAN_HEADER]; uint8_t oran_header[ORAN_HEADER];
uint8_t iq_samples[NORMAL_IQ_PAYLOAD]; uint8_t iq_samples[LONG_IQ_PAYLOAD];
} ecpri_iq_packet; } ecpri_iq_packet;
typedef struct { typedef struct {
...@@ -769,7 +769,7 @@ static void *send_thread(void *p) { ...@@ -769,7 +769,7 @@ static void *send_thread(void *p) {
// Send at most tx_burst packets // Send at most tx_burst packets
int to_send = s->tx_burst / s->tx_n_channel; int to_send = s->tx_burst / s->tx_n_channel;
for(int k = 0; k < s->tx_n_channel; k++) { for(int k = 0; k < s->tx_n_channel; k++) {
to_read = rbuf_read_amount(&trxw_rbuf[k]) / NORMAL_IQ_PAYLOAD; to_read = rbuf_read_amount(&trxw_rbuf[k]) / LONG_IQ_PAYLOAD;
if(to_read < to_send) if(to_read < to_send)
to_send = to_read; to_send = to_read;
} }
...@@ -795,10 +795,10 @@ static void *send_thread(void *p) { ...@@ -795,10 +795,10 @@ static void *send_thread(void *p) {
encode_oran_header(&o, iq_packet->oran_header); encode_oran_header(&o, iq_packet->oran_header);
to_read = rbuf_read_amount(&trxw_rbuf[antenna_id]); to_read = rbuf_read_amount(&trxw_rbuf[antenna_id]);
memcpy(iq_packet->iq_samples, rbuf_read(&trxw_rbuf[antenna_id]), payload_size - 12); memcpy(iq_packet->iq_samples, rbuf_read(&trxw_rbuf[antenna_id]), payload_size);
rbuf_increment_read(&trxw_rbuf[antenna_id], payload_size - 12); rbuf_increment_read(&trxw_rbuf[antenna_id], payload_size);
encoded++; encoded++;
iq_sent += (payload_size - 12) / 4; iq_sent += (payload_size) / 4;
tx_buf_index += payload_size + PACKET_HEADER; tx_buf_index += payload_size + PACKET_HEADER;
} }
increment_oran_counters(&o); increment_oran_counters(&o);
...@@ -1209,26 +1209,22 @@ static void trx_ecpri_write(TRXState *s1, trx_timestamp_t timestamp, const void ...@@ -1209,26 +1209,22 @@ static void trx_ecpri_write(TRXState *s1, trx_timestamp_t timestamp, const void
// Drop samples if we don't have enough space in trx write buffer // Drop samples if we don't have enough space in trx write buffer
if( (count * 4) > rbuf_write_amount(&trxw_rbuf[0]) ) { if( (count * 4) > rbuf_write_amount(&trxw_rbuf[0]) ) {
//log_exit("TRX_ECPRI_WRITE",
// "Not enough space to write in trxw_rbuf (count = %d)", count);
update_counter(&tx_drop_counter, count); update_counter(&tx_drop_counter, count);
return; return;
} }
offset = 0; for(int i = 0; i < s->tx_n_channel; i++) {
count_left = count; offset = 0;
while((nc = rbuf_contiguous_copy(NULL, &trxw_rbuf[0], count_left * 4))) { count_left = count;
for(int i = 0; i < s->tx_n_channel; i++) { while((nc = rbuf_contiguous_copy(NULL, &trxw_rbuf[i], count_left * 4))) {
if(__samples) { if(__samples)
memcpy(rbuf_write(&trxw_rbuf[i]), ((uint8_t *) _samples[i]) + offset, nc); memcpy(rbuf_write(&trxw_rbuf[i]), ((uint8_t *) _samples[i]) + offset, nc);
//memset(rbuf_write(&trxw_rbuf[i]), 0x9e, nc); else
} else {
log_exit("TRX_ECPRI_WRITE", "samples empty during FDD mode"); log_exit("TRX_ECPRI_WRITE", "samples empty during FDD mode");
}
rbuf_increment_write(&trxw_rbuf[i], nc); rbuf_increment_write(&trxw_rbuf[i], nc);
count_left -= nc / 4;
offset += nc;
} }
count_left -= nc / 4;
offset += nc;
} }
update_counter(&write_counter, (s->tx_n_channel * count)); update_counter(&write_counter, (s->tx_n_channel * count));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment