problems while trying to communicate between ATMEL mega169 and ATMEL flash
The only thing I can spot is that stop_transmission() is missing from flash_ready(). 

Your programming sequence is:


fill buffer
wait for ready
program
wait for ready


The program command may be lost since it is not preceded by a falling edge of $\overline{\text{CS}}$.