Hi Neil
The frame transmission interrupt has no idea about the frame's use. Therefore it doesn't know whether it is carrying TCP data nor which socket it is associated with.
If you need to know this you will need to add a reference in the TCP socket part which is sending the data (eg. a variable with the socket number that just passed data for transmission). The interrupt can then look at the variable (i.e. the socket that last transmitted something) and then set it to, say -1, to indicate that it has seen this. Since there are multiple tx buffers it may also be necessary to have a queue of corresponding to these because, theoretically, more than one socket could have started transmission before the first frame complete interrupt arrives.
Regards
Mark