The gemara says that one should not put on tefillin unless they can uphold it's kedusha like elisha ba'al kinafayim. Abaye says that it refers to the ability to stay awake without a concern of dozing in the tefillin, and Rava says that it refers to the ability to maintain the cleanliness of one's body and not pass gas while wearing tefillin. Tosafos explains that it is incorrect to assume that one must be on the level of elisha ba'al kinafayim in any respect, except to maintain a clean body. Therefore, Tosafos bemoans the fact that people are reluctant to put on tefillin and justify their practice by saying that they aren't on the level of elisha ba'al kinafayim.
It is unclear from the opinions of Abaye and Rava which one of the two is more restrictive and which is more permissive. Rashi explains that the concern of falling asleep is really a concern of passing gas in the tefillin, but Rava holds that so long as one can be careful not to fall asleep, we are confident that he can hold himself back from passing gas while awake. Abaye on the other hand is concerned that he won't be able to control himself even while awake, therefore if he is concerned that he may pass gas, he shouldn't put on tefillin. According to Rashi it seems that Rava is more permissive than Abaye.
However, Tosafos understands that Abaye is only concerned for one who is concerned for passing gas, but isn't concerned that someone will fall asleep in inadvertently pass gass, whereas Rava holds that one who is tired and concerned he may fall asleep should also not put on tefillin.
In trying to explain the problem of sleeping with tefillin, both Rashi and Tosafos mention the concern of passing gas, but they each mention a second concern which seems to be rejected by each other. Rashi says that there is a concern that he will see a seminal discharge, which Tosafos explicitly rejects based on a gemara in Succah. Tosafos mentions the concern of a hesech hada'as, mental distraction from the tefillin, which Rashi doesn't mention.
Tosafos is apparently trying to deal with an obvious question. We are aware that there is a prohibition to have a היסח הדעת while wearing tefillin which the gemara learns out from the tzitz. Why then don't we simply say that the problem with sleeping in tefillin is an inherent problem of he'sech ha'daas rather than a concern that he will pass gas? To deal with this question Tosafos says both reasons (see also ohr zarua cited in biur halacha 44 who also cites both reasons). However, the question still stands according to Rashi?
The Rishonim, cited by M.B. 44:3 explain that the definition of היסח הדעת in regard to the mitzvah of tefillin does NOT mean that one needs complete concentration on their tefillin for the duration of time that they are wearing it. Tefillin is a mitzvah that applies all day and therefore one is allowed to to mundane activities and non-kodesh work while wearing tefillin, even though they will not be thinking about the tefillin. The issur of a היסח הדעת in the tefillin is merely to the exclusion of קלות ראש, light headed and inappropriate silly behavior. According to this approach, it seems difficult that the source of this halacha is the tzitz. Would we say by the tzitz as well that the entire prohibition is only against lightheaded behavior. It would seem that the obligation while wearing the tzitz would be not to have any hesech ha'daas from kodesh things at all.
The Sha'agas Aryeh (39) discusses the nature of hesech hada'as in tefillin and concludes that even a hesech hada'as that isn't a קלות ראש can still qualify as a hesech hadaas, against the Rishonim that are quoted in the Mishna Berura.
מענין לענין - The Rambam only paskens the issur of hesech hada'as in hilchos tefillin 4:14, but doesn't make any mention of it in hilchos klei hamikdash. However, in Hilchos Tefillin the Rambam does write that the source of the issur of hesech hada'as in tefillin is from the tzitz. Why does he not mention it in Hilchos Klei HaMikdash? The Minchas Chinuch 99 makes the point, but doesn't deal with the question.