172 | | == Functions == |
173 | | [source:/ResearchApps/MAC/ACKMAC/src/ackmac.c@91#L1022 ackmac_main] |
174 | | |
175 | | This function is the primary thread spawned by the xilkernel via the shell. It really has two purposes: during startup it must initialize memory spaces and do general set-up tasks such as setting up interrupts, and during all other times, it polls over status bytes that determine if the node is ready and able to transmit a new packet, and if so, it calls the tx function. |
176 | | |
177 | | [source:/ResearchApps/MAC/ACKMAC/src/ackmac.c@91#L547 tx] |
| 174 | == Base Station Functions == |
| 175 | [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 timer_a_int_handler] |
| 176 | This is the interrupt handler for the first timer peripheral. It checks to see which was the state it was called in and then changes values of |
| 177 | global variables accordingly. This is mainly used to tell when the slot for receiving and transmitting ends. |
| 178 | |
| 179 | |
| 180 | [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 rxPhyBad] |
| 181 | This function is used to keep a track of the number of bad packets ( CRC Error ) Received. After receiving it simply |
| 182 | resets the receiver. |
| 183 | |
| 184 | |
| 185 | [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 rxPhyGood] |
| 186 | This function is called when a packet with the correct CRC is received. It copies the packet into the memory. It then checks the state of the |
| 187 | BS machine and the Connection ID of the packet received with the expected Connection ID. Else it simply frees the buffer and in the end |
| 188 | resets the receiver. Note, the resetting of the receiver is a must and it must be the last step after packet processing. |
| 189 | |
| 190 | |
| 191 | [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 BSRxInsertQueuebyMAC] |
| 192 | The function is called when a packet needs to be inserted into a specific queue of the Base Station. This abstracts the behaviour of the |
| 193 | PHY-MAC interaction. The queues are circular and this maintains a notion of a flag, to ensure it does not overwrite on any queue location. |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |